[Confused(sqlite)]What will occur if does not use db_free_result?
#3

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...

pawn Код:
main()
{
        new object;
        object = CreateObject(...);
        return;
}
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?
Reply


Messages In This Thread
[Unsolved][SQLite]What will occur if does not use db_free_result? - by yezizhu - 05.09.2010, 01:40
Re: [Confused(sqlite)]What will occur if does not use db_free_result? - by yezizhu - 06.09.2010, 10:37
Re: [Unsolved][SQLite]What will occur if does not use db_free_result? - by RoBo - 06.09.2010, 11:28
Re: [Confused(sqlite)]What will occur if does not use db_free_result? - by yezizhu - 06.09.2010, 15:18

Forum Jump:


Users browsing this thread: 3 Guest(s)