View Single Post
xm3kilo
Member
Join Date: Jan 2018
Old 03-10-2018 , 12:44   Re: DataPacks and queries leaking?
Reply With Quote #7

Quote:
Originally Posted by pride95 View Post
PHP Code:

    DataPack pk 
= new DataPack();
    
    if(
iClientpk.WriteCell(GetClientSerial(iClient));
    else 
pk.WriteCell(0);

    
char cQuery[256];
    
FormatEx(cQuerysizeof(cQuery), "SELECT NULL FROM `bans_table` WHERE `steamid` = '%s';"cSteam);
    
dDatabase.Query(SQL_OnAddbanCommandcQuerypkDBPrio_Normal);


public 
void SQL_OnAddbanCommand(Database dbDBResultSet rs, const char[] errorany data)
{
    if(
rs != null)
    {
        
DataPack pk view_as<DataPack>(data);
        
pk.Reset();
        
        
int iClient GetClientFromSerial(pk.ReadCell());
        
        
etc

        delete pk
;
    }

this is what i'm using. no leak memory.
Damn, this was the output of the sourcemod_fatal.log

Code:
L 03/09/2018 - 20:43:31: --------------------------------------------------------------------------
L 03/09/2018 - 20:43:31: Type	IBaseMenu           |	Count	127
L 03/09/2018 - 20:43:31: Type	IQuery              |	Count	14892
L 03/09/2018 - 20:43:31: Type	IDatabase           |	Count	18
L 03/09/2018 - 20:43:31: Type	DataPack            |	Count	1203
L 03/09/2018 - 20:43:31: -- Approximately 165916 bytes of memory are in use by (16240) Handles.
xm3kilo is offline