During shutdown we want the account object to be deleted and
therefore we need to be able to remove the strong reference
in AccountManager.
emit accountStateRemoved(_accountState);
}
_accountState = accountState;
- emit accountStateAdded(accountState);
+ if (accountState) {
+ emit accountStateAdded(accountState);
+ }
}
void AccountStateManager::slotAccountAdded(AccountPtr account)
Application::~Application()
{
- // qDebug() << "* OCC shutdown";
+ // Remove the account from the account manager so it can be deleted.
+ AccountManager::instance()->setAccount(AccountPtr());
}
void Application::slotLogin()
emit accountRemoved(_account);
}
_account = account;
- emit accountAdded(account);
+ if (account) {
+ emit accountAdded(account);
+ }
}