diff options
author | Marcus Boerger <helly@php.net> | 2003-08-23 15:38:58 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-08-23 15:38:58 +0000 |
commit | fbda310a41299913e39385f15762924bde2f48cb (patch) | |
tree | c84d399d55e1f7bca9009bffab22de64931e8121 /Zend/zend_API.c | |
parent | 43334207abd34dcb444fce526d11481577b356ce (diff) | |
download | php-git-fbda310a41299913e39385f15762924bde2f48cb.tar.gz |
- Flag ctor/dtor methods
- Use this to prevent memleaks when an exception gets thrown in ctors.
# I added the dtor flags for consistency, atm a compareable check in
# isn't necessary for destruction. But anyway i'll use this for the
# Relection API too.
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index ac459028d8..7d5745b4f7 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1241,6 +1241,12 @@ int zend_register_functions(zend_class_entry *scope, zend_function_entry *functi scope->constructor = ctor; scope->destructor = dtor; scope->clone = clone; + if (ctor) { + ctor->common.fn_flags |= ZEND_ACC_CTOR; + } + if (dtor) { + dtor->common.fn_flags |= ZEND_ACC_DTOR; + } } return SUCCESS; } |