Skip to content

Commit ae610be

Browse files
author
Fabian Müller
committed
Make sure settings are in a consistent state
1 parent d84d4c5 commit ae610be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gui/accountmanager.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,12 @@ AccountStatePtr AccountManager::addAccount(const AccountPtr &newAccount)
371371

372372
AccountStatePtr newAccountState(AccountState::fromNewAccount(newAccount));
373373
addAccountState(newAccountState);
374+
375+
// saving once after adding makes sure the account is stored in the config in a working state
376+
// this is needed to ensure a consistent state in the config file upon unexpected terminations of the client
377+
// (for instance, when running from a debugger and stopping the process from there)
378+
saveAccount(newAccount.get());
379+
374380
return newAccountState;
375381
}
376382

0 commit comments

Comments
 (0)