Skip to content

Commit a65d578

Browse files
committed
finally fix the elusive memory leak
1 parent 0a68147 commit a65d578

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Zend/zend.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#include "zend.h"
2121

22-
#include <zend_namespaces.h>
23-
2422
#include "zend_extensions.h"
2523
#include "zend_modules.h"
2624
#include "zend_constants.h"
@@ -1232,7 +1230,6 @@ void zend_shutdown(void) /* {{{ */
12321230

12331231
zend_optimizer_shutdown();
12341232

1235-
zend_destroy_namespaces();
12361233
startup_done = false;
12371234
}
12381235
/* }}} */

Zend/zend_namespaces.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static zend_class_entry *insert_namespace(const zend_string *name) {
4949
while (pos <= end) {
5050
if (pos == end || *pos == '\\') {
5151
len = pos - start;
52-
zend_string *needle = zend_string_init(ZSTR_VAL(name), len, 1);
52+
zend_string *needle = zend_string_init(ZSTR_VAL(name), len, 0);
5353

5454
ns = zend_hash_find_ptr(&namespaces, needle);
5555

main/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
#include <sys/wait.h>
6767
#endif
6868

69+
#include "zend_namespaces.h"
70+
6971
#include "zend_compile.h"
7072
#include "zend_execute.h"
7173
#include "zend_highlight.h"
@@ -1956,6 +1958,7 @@ void php_request_shutdown(void *dummy)
19561958
} zend_end_try();
19571959

19581960
/* 9. Shutdown scanner/executor/compiler and restore ini entries */
1961+
zend_destroy_namespaces();
19591962
zend_deactivate();
19601963

19611964
/* 10. free request-bound globals */

0 commit comments

Comments
 (0)