diff options
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r-- | Zend/zend_opcode.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 9b305b25e2..a4bf456c12 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -138,18 +138,20 @@ ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC) ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC) { - if ((*pce)->static_members) { - if ((*pce)->static_members != &(*pce)->default_static_members) { - zend_hash_destroy((*pce)->static_members); - FREE_HASHTABLE((*pce)->static_members); - } - (*pce)->static_members = NULL; - } if ((*pce)->type == ZEND_USER_CLASS) { /* Clean all parts that can contain run-time data */ /* Note that only run-time accessed data need to be cleaned up, pre-defined data can not contain objects and thus are not probelmatic */ zend_hash_apply(&(*pce)->function_table, (apply_func_t) zend_cleanup_function_data TSRMLS_CC); + (*pce)->static_members = NULL; + } else if (CE_STATIC_MEMBERS(*pce)) { + zend_hash_destroy(CE_STATIC_MEMBERS(*pce)); + FREE_HASHTABLE(CE_STATIC_MEMBERS(*pce)); +#ifdef ZTS + CG(static_members)[(long)((*pce)->static_members)] = NULL; +#else + (*pce)->static_members = NULL; +#endif } return 0; } |