Skip to content

Commit 0a699bf

Browse files
committed
Detail MySQL_Prepared_ResultSet::closeIntern() call to proxy->stmt_free_result();
1 parent a996a55 commit 0a699bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

driver/mysql_ps_resultset.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ void
253253
MySQL_Prepared_ResultSet::closeIntern()
254254
{
255255
CPP_ENTER("MySQL_Prepared_ResultSet::closeIntern");
256-
//if this is the only one, free result
256+
//We nee here to check how many MySQL_Prepared_ResultSet instances
257+
//exist. Since each one of them has a result_bind, we can use his use_cont
258+
//to check if it equals 2 (1 here + 1 on MySQL_Prepared_Statement (parent))
259+
//Only on this case, we can call proxy->stmt_free_result();
257260
if (result_bind.use_count() == 2)
258261
proxy->stmt_free_result();
259262
is_valid = false;

0 commit comments

Comments
 (0)