mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
emalloced interned strings have to be deallocated before memory manager shutdown
This commit is contained in:
parent
fc5e9bee29
commit
4d6ff31cb3
@ -189,10 +189,14 @@ static void zend_interned_strings_restore_int(TSRMLS_D)
|
||||
while (idx > 0) {
|
||||
idx--;
|
||||
p = CG(interned_strings).arData + idx;
|
||||
if (!(p->key->gc.u.v.flags & IS_STR_PERMANENT)) break;
|
||||
if (p->key->gc.u.v.flags & IS_STR_PERMANENT) break;
|
||||
CG(interned_strings).nNumUsed--;
|
||||
CG(interned_strings).nNumOfElements--;
|
||||
|
||||
p->key->gc.u.v.flags &= ~IS_STR_INTERNED;
|
||||
p->key->gc.refcount = 1;
|
||||
STR_FREE(p->key);
|
||||
|
||||
nIndex = p->h & CG(interned_strings).nTableMask;
|
||||
if (CG(interned_strings).arHash[nIndex] == idx) {
|
||||
CG(interned_strings).arHash[nIndex] = p->val.u.next;
|
||||
|
@ -1827,10 +1827,10 @@ void php_request_shutdown(void *dummy)
|
||||
} zend_end_try();
|
||||
|
||||
/* 14. Free Willy (here be crashes) */
|
||||
zend_interned_strings_restore(TSRMLS_C);
|
||||
zend_try {
|
||||
shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC);
|
||||
} zend_end_try();
|
||||
zend_interned_strings_restore(TSRMLS_C);
|
||||
|
||||
/* 15. Reset max_execution_time */
|
||||
zend_try {
|
||||
|
Loading…
Reference in New Issue
Block a user