summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-12-01 11:48:17 +0000
committerDmitry Stogov <dmitry@php.net>2005-12-01 11:48:17 +0000
commit8768ab94b38f96e540995f31ce17bb4e1e4210f8 (patch)
tree90a1d85b08b8af63a74fdf8c20224fd89d85aa18 /Zend/zend_opcode.c
parent673dc5ee5f1f96439b2bf540df3968c31248ca4e (diff)
downloadphp-git-8768ab94b38f96e540995f31ce17bb4e1e4210f8.tar.gz
Fixed bug #34729 (Crash in ZTS mode under Apache)
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c16
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;
}