Fixed various memory leaks.

This commit is contained in:
Greyscale 2009-07-23 17:05:04 -07:00
parent 37fe9fae8b
commit d5e4e89ba5
5 changed files with 24 additions and 0 deletions

View File

@ -197,6 +197,8 @@ InfectOnClientDisconnect(client)
// If there are no eligible client's then stop.
if (!eligibleclients)
{
// Destroy handle.
CloseHandle(arrayEligibleClients);
return;
}
@ -416,6 +418,8 @@ public Action:InfectMotherZombie(Handle:timer)
// If there are no eligible client's then stop.
if (!eligibleclients)
{
// Destroy handle.
CloseHandle(arrayEligibleClients);
return;
}

View File

@ -302,6 +302,10 @@ stock ModelsGetRandomModelIndex(String:modelpath[], maxlen, bool:all = true, boo
if (size == 0)
{
strcopy(modelpath, maxlen, "");
// Destroy the handle.
CloseHandle(modelsarray);
return;
}

View File

@ -409,6 +409,11 @@ ClassLoad(bool:keepMultipliers = false)
if (!exists)
{
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Playerclasses, "Config Validation", "Missing playerclasses config file \"%s\"", pathclasses);
// Remove key/value cache.
CloseHandle(kvClassData);
kvClassData = INVALID_HANDLE;
return;
}

View File

@ -340,6 +340,9 @@ RoundEndBalanceTeams()
// If there are no eligible client's then stop.
if (!eligibleclients)
{
// Destroy handle.
CloseHandle(arrayEligibleClients);
return;
}

View File

@ -78,6 +78,10 @@ SayHooksGetPublicChatTrigger(String:trigger[], maxlen)
if (!success)
{
strcopy(trigger, maxlen, SAYHOOKS_CHAT_PUBLIC_DEFAULT);
// Close the handle.
CloseHandle(kvCore);
return;
}
@ -117,6 +121,10 @@ SayHooksGetSilentChatTrigger(String:trigger[], maxlen)
if (!success)
{
strcopy(trigger, maxlen, SAYHOOKS_CHAT_SILENT_DEFAULT);
// Close the handle.
CloseHandle(kvCore);
return;
}