07.08.2011, 23:33
Well I used the mysql_debug(1) function to see what's going on in my script. I noticed that it stored the result even though I don't have anything in that table, but it did not free it, I'm wondering if that could cause a memory leak.
This is what a normal query of mine would look like:
Please ignore the indentation, the forum messed it up -_-
Note: I don't have anything in the 'vehicle2' table. Should I still add 'mysql_free_result even though I don't have it, the result was stored......
If you want to see the log I'll provide it.
This is what a normal query of mine would look like:
pawn Код:
format(vfile,sizeof(vfile),"SELECT * FROM vehicle2 WHERE Owner = '%s' LIMIT 1",escape);
mysql_query(vfile);
mysql_store_result();
if(mysql_num_rows() != 0)
{
mysql_free_result();
GetVehiclePos(CarSystem[playerid][vID][1],X,Y,Z);
GetVehicleZAngle(CarSystem[playerid][vID][1],A);
format(String,sizeof(String),"UPDATE vehicle2 SET vModel = %d, XSpawn = %f, YSpawn = %f, ZSpawn = %f, Angle = %f WHERE Owner = '%s'",GetVehicleModel(CarSystem[playerid][vID][1]),X,Y,Z,A,escape);
mysql_query(String);
format(String,sizeof(String),"UPDATE vehicle2 SET vMod0 = %d,vMod1 = %d,vMod2 = %d,vMod3 = %d,vMod4 = %d,vMod5 = %d,vMod6 = %d,vMod7 = %d,vMod8 = %d,vMod9 = %d,vMod10 = %d,vMod11 = %d,vMod12 = %d WHERE Owner = '%s'",
CarSystem[playerid][vMods2][0],CarSystem[playerid][vMods2][1],CarSystem[playerid][vMods2][2],CarSystem[playerid][vMods2][3],CarSystem[playerid][vMods2][4],CarSystem[playerid][vMods2][5],CarSystem[playerid][vMods2][6],CarSystem[playerid][vMods2][7],CarSystem[playerid][vMods2][8],CarSystem[playerid][vMods2][9],CarSystem[playerid][vMods2][10],CarSystem[playerid][vMods2][11],CarSystem[playerid][vMods2][12],escape);
mysql_query(String);
}
Note: I don't have anything in the 'vehicle2' table. Should I still add 'mysql_free_result even though I don't have it, the result was stored......
If you want to see the log I'll provide it.