CookieJar: Don't accidentally overwrite cookies. #2808
authorChristian Kamm <kamm@incasoftware.de>
Fri, 27 Mar 2015 09:49:24 +0000 (10:49 +0100)
committerChristian Kamm <kamm@incasoftware.de>
Fri, 27 Mar 2015 09:49:24 +0000 (10:49 +0100)
commit54836822813a18c725c2916232103779ef9e75ab
tree477473a9bfadd260e9e174141f130233edba4d55
parent2a8c23aac3d44cb9db8a5a977834123b5d75bf1c
CookieJar: Don't accidentally overwrite cookies. #2808

Calling save() in the CookieJar destructor was problematic. For instance
we sometimes create a new QNAM with a new CookieJar and then call
setCookieJar() on it to assign some other jar. That destroy the fresh
jar and potentially overwrite cookies.

Also explicitly saving the account's cookies when the account is saved
is more explicit and thus more reliable than counting on the Account
destructor to do it.
src/libsync/account.cpp
src/libsync/cookiejar.cpp
src/libsync/cookiejar.h