So we of course have queries being called in the following manner:
PHP Code:
public void doMySQL() {
Handle g_hDB = Some Valid MySQL Handle; //PART1
char sQuery[256] = "SELECT * FROM mytable WHERE myconditions=true;";
SQL_TQuery(g_hDB, SQL_HandleQuery, sQuery);
}
public void SQL_HandleQuery(Handle db, Handle results, char[] sError, any data) {
if(db != INVALID_HANDLE)
delete db; //PART2
}
So at //PART1 I have g_hDB which is a handle to a valid database. If I use this handle, the query is going to work, and eventually a response (or error) will come along to the callback.
The callback has "Handle db" as a parameter. This handle is a handle to the same database as g_hDB.
My question is, is db a clone of g_hDB. If I do "delete db" at the line commented with //PART2, then would I also be closing g_hDB? Or is db just a reference to the same handle as g_hDB?
Lastly, is it necessary to delete db? Assuming db is a clone of g_hDB. I only ask this because I have gone over a year without my plugin, which performs MANY queries, being closed due to a memory leak.