Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

ResultSet memory cleanup (no replies)

$
0
0
Good day,

From documentation it's unclear when "ResultSet* Statement::executeQuery" function's returned ResultSet should be deleted. For example, should ResultSet be deleted after every executeQuery call?

sql::Statement* stmt = 0;
sql::ResultSet* res = 0;

// ...

for (unsigned short i = 0; i < 50; i++)
{
res = stmt->executeQuery("SELECT * FROM table1;");
while (res->next())
{
// ...
}
delete res;
res = 0;
}

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>