File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -58,16 +58,6 @@ static void php_phongo_cursor_free_current(php_phongo_cursor_t *cursor) /* {{{ *
5858 }
5959} /* }}} */
6060
61- void php_phongo_cursor_free (php_phongo_cursor_t * cursor ) /* {{{ */
62- {
63- if (cursor -> cursor ) {
64- mongoc_cursor_destroy (cursor -> cursor );
65- cursor -> cursor = NULL ;
66- }
67-
68- php_phongo_cursor_free_current (cursor );
69- } /* }}} */
70-
7161/* {{{ Iterator handlers */
7262static void php_phongo_cursor_iterator_dtor (zend_object_iterator * iter TSRMLS_DC ) /* {{{ */
7363{
@@ -386,6 +376,10 @@ static void php_phongo_cursor_free_object(phongo_free_object_arg *object TSRMLS_
386376
387377 zend_object_std_dtor (& intern -> std TSRMLS_CC );
388378
379+ if (intern -> cursor ) {
380+ mongoc_cursor_destroy (intern -> cursor );
381+ }
382+
389383 if (intern -> database ) {
390384 efree (intern -> database );
391385 }
@@ -406,7 +400,7 @@ static void php_phongo_cursor_free_object(phongo_free_object_arg *object TSRMLS_
406400 zval_ptr_dtor (& intern -> read_preference );
407401 }
408402
409- php_phongo_cursor_free (intern );
403+ php_phongo_cursor_free_current (intern );
410404
411405 zval_ptr_dtor (& intern -> manager );
412406
You can’t perform that action at this time.
0 commit comments