]> granicus.if.org Git - php/commitdiff
Use different method to suppress "false" memory leak reports
authorDmitry Stogov <dmitry@zend.com>
Fri, 22 Feb 2019 07:11:43 +0000 (10:11 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 22 Feb 2019 07:11:43 +0000 (10:11 +0300)
ext/opcache/ZendAccelerator.c

index f5fa1d931b6482321321d669dc3562ef75645ba0..48a59928b47d4d9b8f7f524098e5b4ec4ed37609 100644 (file)
@@ -4129,9 +4129,6 @@ static int accel_finish_startup(void)
                zend_bool old_reset_signals = SIGG(reset);
 #endif
 
-               /* Cleanup heap, to avoid memory leak reports */
-               shutdown_memory_manager(1, 0);
-
                if (UNEXPECTED(file_cache_only)) {
                        zend_accel_error(ACCEL_LOG_WARNING, "Preloading doesn't work in \"file_cache_only\" mode");
                        return SUCCESS;
@@ -4171,6 +4168,7 @@ static int accel_finish_startup(void)
                EG(error_reporting) = orig_error_reporting;
 
                if (rc == SUCCESS) {
+                       zend_bool orig_report_memleaks;
 
                        /* don't send headers */
                        SG(headers_sent) = 1;
@@ -4192,7 +4190,10 @@ static int accel_finish_startup(void)
                                ret = FAILURE;
                        }
 
+                       orig_report_memleaks = PG(report_memleaks);
+                       PG(report_memleaks) = 0;
                        php_request_shutdown(NULL);
+                       PG(report_memleaks) = orig_report_memleaks;
                } else {
                        ret = FAILURE;
                }