Fix some memleaks :^)
This commit is contained in:
parent
4c6a9e7f57
commit
3818fea767
@ -356,6 +356,9 @@ public void APIWebResponse(const char[] sData, int client)
|
||||
return;
|
||||
}
|
||||
|
||||
if(g_FriendsArray[client] != INVALID_HANDLE)
|
||||
CloseHandle(g_FriendsArray[client]);
|
||||
|
||||
g_FriendsArray[client] = CreateArray();
|
||||
|
||||
char sCommunityID[32];
|
||||
|
@ -122,7 +122,10 @@ public Action Command_ForceInput(int client, int args)
|
||||
int entity = TR_GetEntityIndex(hTrace);
|
||||
|
||||
if(entity <= 1 || !IsValidEntity(entity))
|
||||
{
|
||||
CloseHandle(hTrace);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
if(sArguments[2][0])
|
||||
SetVariantString(sArguments[2]);
|
||||
@ -130,6 +133,7 @@ public Action Command_ForceInput(int client, int args)
|
||||
AcceptEntityInput(entity, sArguments[1], client, client);
|
||||
ReplyToCommand(client, "[SM] Input successful.");
|
||||
}
|
||||
CloseHandle(hTrace);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -108,14 +108,15 @@ public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], co
|
||||
|
||||
public void AsyncHasSteamIDReservedSlotCallback(const char[] sSteam32ID, int Result, any Data)
|
||||
{
|
||||
DataPack pack = view_as<DataPack>(Data);
|
||||
// Slot free'd up while waiting or doesn't have a reserved slot?
|
||||
if(GetClientCount(false) < MaxClients || Result <= 0)
|
||||
{
|
||||
delete pack;
|
||||
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
|
||||
return;
|
||||
}
|
||||
|
||||
DataPack pack = view_as<DataPack>(Data);
|
||||
pack.Reset();
|
||||
|
||||
AdminId admin = view_as<AdminId>(pack.ReadCell());
|
||||
|
@ -486,6 +486,14 @@ public Action Command_NominateList(int client, int args)
|
||||
|
||||
public int Handler_NominateListMenu(Handle menu, MenuAction action, int param1, int param2)
|
||||
{
|
||||
switch(action)
|
||||
{
|
||||
case MenuAction_End:
|
||||
{
|
||||
delete menu;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user