Fixed mem leak in clientprefs
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402310
This commit is contained in:
parent
8a5d833c89
commit
cdf54a3db1
@ -222,6 +222,8 @@ void CookieManager::OnClientDisconnecting(int client)
|
||||
|
||||
if (!current->changed)
|
||||
{
|
||||
current->parent->data[client] = NULL;
|
||||
delete current;
|
||||
_iter = clientData[client].erase(_iter);
|
||||
continue;
|
||||
}
|
||||
@ -314,7 +316,6 @@ void CookieManager::ClientConnectCallback(int client, IQuery *data)
|
||||
|
||||
} while (results->MoreRows());
|
||||
|
||||
|
||||
statsLoaded[client] = true;
|
||||
|
||||
cookieDataLoadedForward->PushCell(client);
|
||||
|
@ -194,7 +194,6 @@ bool ClientPrefs::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
phrases->AddPhraseFile("clientprefs.phrases");
|
||||
phrases->AddPhraseFile("common.phrases");
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -206,6 +205,7 @@ void ClientPrefs::SDK_OnAllLoaded()
|
||||
void ClientPrefs::SDK_OnUnload()
|
||||
{
|
||||
handlesys->RemoveType(g_CookieType, myself->GetIdentity());
|
||||
handlesys->RemoveType(g_CookieIterator, myself->GetIdentity());
|
||||
|
||||
g_CookieManager.Unload();
|
||||
|
||||
@ -214,6 +214,11 @@ void ClientPrefs::SDK_OnUnload()
|
||||
forwards->ReleaseForward(g_CookieManager.cookieDataLoadedForward);
|
||||
|
||||
g_CookieManager.clientMenu->Destroy();
|
||||
|
||||
phrases->Destroy();
|
||||
|
||||
plsys->RemovePluginsListener(&g_CookieManager);
|
||||
playerhelpers->RemoveClientListener(&g_CookieManager);
|
||||
}
|
||||
|
||||
size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...)
|
||||
|
@ -98,6 +98,7 @@ TQueryOp::TQueryOp(IDatabase *db, const char *query, enum querytype type, int cl
|
||||
m_Query = query;
|
||||
m_type = type;
|
||||
m_client = client;
|
||||
m_pQuery = NULL;
|
||||
|
||||
m_pDatabase->IncReferenceCount();
|
||||
}
|
||||
@ -108,6 +109,7 @@ TQueryOp::TQueryOp(IDatabase *db, const char *query, enum querytype type, Cookie
|
||||
m_Query = query;
|
||||
m_type = type;
|
||||
pCookie = cookie;
|
||||
m_pQuery = NULL;
|
||||
|
||||
m_pDatabase->IncReferenceCount();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user