06.09.2010, 11:28
db_query does not actually return the result of the query, it returns a number that points to the query (essentially a pointer). If you delete the pointer to the query then the query will still exist, but there will be no way to access/delete it, keep doing queries and not freeing the result and you'll end up with a memory leak. db_free_result actually clears the result within the server. A little example...
That code will assign the objectid to "object", when main has finished executing "object" will be cleared from the heap, but that actual ingame object will still exist, all you will have done it delete the pointer to it.
Understand?
pawn Код:
main()
{
new object;
object = CreateObject(...);
return;
}
Understand?