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) /* {{{ */
146
146
_php_ibase_free_xsqlda (ib_result -> out_sqlda );
147
147
if (ib_result -> query != NULL ) {
148
148
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
+ }
150
153
} else {
151
154
_php_ibase_free_stmt_handle (ib_result -> link , ib_result -> stmt );
152
155
}
@@ -167,7 +170,9 @@ static void _php_ibase_free_query(ibase_query *ib_query) /* {{{ */
167
170
}
168
171
if (ib_query -> result != NULL ) {
169
172
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
+ }
171
176
} else {
172
177
_php_ibase_free_stmt_handle (ib_query -> link , ib_query -> stmt );
173
178
}
You can’t perform that action at this time.
0 commit comments