diff --git a/src/online/current_user.cpp b/src/online/current_user.cpp index 43f3cff30..bf407cff4 100644 --- a/src/online/current_user.cpp +++ b/src/online/current_user.cpp @@ -201,6 +201,7 @@ namespace Online{ request->setParameter("userid", getID()); HTTPManager::get()->addRequest(request); setUserState (US_SIGNING_OUT); + HTTPManager::get()->stopPolling(); return request; } @@ -211,13 +212,12 @@ namespace Online{ Log::warn("CurrentUser::signOut", "%s", _("There were some connection issues while signing out. Report a bug if this caused issues.")); } setToken(""); - ProfileManager::get()->deleteFromPersistent(m_profile->getID()); + ProfileManager::get()->clearPersistent(); m_profile = NULL; setUserState (US_SIGNED_OUT); UserConfigParams::m_saved_user = 0; UserConfigParams::m_saved_token = ""; UserConfigParams::m_saved_session = false; - HTTPManager::get()->stopPolling(); } void CurrentUser::SignOutRequest::callback() diff --git a/src/online/profile_manager.cpp b/src/online/profile_manager.cpp index 437283e41..bbb7d4b02 100644 --- a/src/online/profile_manager.cpp +++ b/src/online/profile_manager.cpp @@ -142,6 +142,17 @@ namespace Online{ // ============================================================================ + void ProfileManager::clearPersistent() + { + ProfilesMap::iterator it; + for ( it = m_profiles_persistent.begin(); it != m_profiles_persistent.end(); ++it ) { + delete it->second; + } + m_profiles_persistent.clear(); + } + + // ============================================================================ + void ProfileManager::moveToCache(const uint32_t id) { if (inPersistent(id)) diff --git a/src/online/profile_manager.hpp b/src/online/profile_manager.hpp index 4aeac4e14..9bab8b5da 100644 --- a/src/online/profile_manager.hpp +++ b/src/online/profile_manager.hpp @@ -60,6 +60,7 @@ namespace Online{ void addToCache(Profile * profile); void addPersistent(Profile * profile); void deleteFromPersistent(const uint32_t id); + void clearPersistent(); void moveToCache(const uint32_t id); void setVisiting(const uint32_t id); bool cacheHit(const uint32_t id);