File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,10 @@ static void _php_ibase_free_result(zend_resource *rsrc) /* {{{ */
146146 _php_ibase_free_xsqlda (ib_result -> out_sqlda );
147147 if (ib_result -> query != NULL ) {
148148 IBDEBUG ("query still valid; don't drop statement handle" );
149- ib_result -> query -> result = NULL ; /* Indicate to query, that result is released */
149+ if (ib_result -> query -> result == ib_result ) {
150+ /* If we are the last execution result on the query */
151+ ib_result -> query -> result = NULL ; /* Indicate to query, that result is released */
152+ }
150153 } else {
151154 _php_ibase_free_stmt_handle (ib_result -> link , ib_result -> stmt );
152155 }
@@ -167,7 +170,9 @@ static void _php_ibase_free_query(ibase_query *ib_query) /* {{{ */
167170 }
168171 if (ib_query -> result != NULL ) {
169172 IBDEBUG ("result still valid; don't drop statement handle" );
170- ib_query -> result -> query = NULL ; /* Indicate to result, that query is released */
173+ if (ib_query -> result -> query == ib_query ) {
174+ ib_query -> result -> query = NULL ; /* Indicate to result, that query is released */
175+ }
171176 } else {
172177 _php_ibase_free_stmt_handle (ib_query -> link , ib_query -> stmt );
173178 }
You can’t perform that action at this time.
0 commit comments