Cache issues fixed.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13545 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx 2013-08-22 15:35:40 +00:00
parent 136185969f
commit 5ada92b251
3 changed files with 14 additions and 2 deletions

View File

@ -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()

View File

@ -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))

View File

@ -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);