Fixed crash regression in cset 90159516acd3 when player auth is invalid (bug 5538, r=asherkin).
This commit is contained in:
parent
54012523bc
commit
d24c751eef
@ -198,7 +198,7 @@ void CookieManager::OnClientDisconnecting(int client)
|
|||||||
statsLoaded[client] = false;
|
statsLoaded[client] = false;
|
||||||
statsPending[client] = false;
|
statsPending[client] = false;
|
||||||
|
|
||||||
CookieData *current;
|
CookieData *current = NULL;
|
||||||
|
|
||||||
g_ClientPrefs.AttemptReconnection();
|
g_ClientPrefs.AttemptReconnection();
|
||||||
|
|
||||||
@ -210,25 +210,16 @@ void CookieManager::OnClientDisconnecting(int client)
|
|||||||
if (player)
|
if (player)
|
||||||
{
|
{
|
||||||
pAuth = player->GetAuthString();
|
pAuth = player->GetAuthString();
|
||||||
|
g_ClientPrefs.ClearQueryCache(player->GetSerial());
|
||||||
}
|
}
|
||||||
|
|
||||||
g_ClientPrefs.ClearQueryCache(player->GetSerial());
|
|
||||||
|
|
||||||
for (SourceHook::List<CookieData *>::iterator _iter = clientData[client].begin();\
|
for (SourceHook::List<CookieData *>::iterator _iter = clientData[client].begin();\
|
||||||
_iter != clientData[client].end(); _iter++)
|
_iter != clientData[client].end(); _iter++)
|
||||||
{
|
{
|
||||||
if (player == NULL || pAuth == NULL)
|
|
||||||
{
|
|
||||||
/* panic! */
|
|
||||||
current->parent->data[client] = NULL;
|
|
||||||
delete current;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
current = (CookieData *)*_iter;
|
current = (CookieData *)*_iter;
|
||||||
dbId = current->parent->dbid;
|
dbId = current->parent->dbid;
|
||||||
|
|
||||||
if (!current->changed || dbId == -1)
|
if (player == NULL || pAuth == NULL || !current->changed || dbId == -1)
|
||||||
{
|
{
|
||||||
current->parent->data[client] = NULL;
|
current->parent->data[client] = NULL;
|
||||||
delete current;
|
delete current;
|
||||||
|
Loading…
Reference in New Issue
Block a user