diff --git a/main/output.c b/main/output.c index 75637438503..25718b5819e 100644 --- a/main/output.c +++ b/main/output.c @@ -247,7 +247,9 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS } } OG(ob_lock) = 0; - zval_ptr_dtor(&OG(active_ob_buffer).output_handler); + if (!just_flush) { + zval_ptr_dtor(&OG(active_ob_buffer).output_handler); + } orig_buffer->refcount -=2; if (orig_buffer->refcount <= 0) { /* free the zval */ zval_dtor(orig_buffer);