diff options
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r-- | Zend/zend_opcode.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 672a55bf8f..6e5ca2aad2 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -106,8 +106,10 @@ ZEND_API void destroy_zend_function(zend_function *function) } -ZEND_API void destroy_zend_class(zend_class_entry *ce) +ZEND_API void destroy_zend_class(zend_class_entry **pce) { + zend_class_entry *ce = *pce; + if (--(*ce->refcount)>0) { return; } @@ -122,6 +124,7 @@ ZEND_API void destroy_zend_class(zend_class_entry *ce) FREE_HASHTABLE(ce->static_members); zend_hash_destroy(&ce->constants_table); zend_hash_destroy(&ce->class_table); + efree(ce); break; case ZEND_INTERNAL_CLASS: zend_hash_destroy(&ce->default_properties); @@ -133,6 +136,7 @@ ZEND_API void destroy_zend_class(zend_class_entry *ce) free(ce->static_members); zend_hash_destroy(&ce->constants_table); zend_hash_destroy(&ce->class_table); + free(ce); break; } } |