Memory leak on changing SQL propery
Posted: 31.08.2007, 00:10
Using ZQuery component with different queries. Same ZQurey component is used with different queries by clearing and reloading the SQL property. This causes a memory leak. In Bcb4, can be reproduced with the following code:
ZQuery1->Close();
ZQuery1->SQL->Clear();
ZQuery1->SQL->Add("INSERT INTO `logopak`.`logtest2` VALUES (NULL, CURRENT_TIMESTAMP, 'Abcdef', 123, 123.456)");
It's not necessary to make a connection to the database or open/ execute the query, just setting the SQL property is enough.
P.s. For best results, make a loop to add 100 (or more) strings to the SQL property when a push-button is activated...
Mr Frustrated (alias Jon)
ZQuery1->Close();
ZQuery1->SQL->Clear();
ZQuery1->SQL->Add("INSERT INTO `logopak`.`logtest2` VALUES (NULL, CURRENT_TIMESTAMP, 'Abcdef', 123, 123.456)");
It's not necessary to make a connection to the database or open/ execute the query, just setting the SQL property is enough.
P.s. For best results, make a loop to add 100 (or more) strings to the SQL property when a push-button is activated...
Mr Frustrated (alias Jon)