Re: weird new leak when passing objects (testcase included).

From: Date: Wed, 13 Dec 2000 23:10:01 +0000
Subject: Re: weird new leak when passing objects (testcase included).
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-41245@lists.php.net to get a copy of this message
First off, it's not a new leak. I've tested 4.0.3 just to make sure, and that version leaked as well. Second, I fixed it in the latest CVS. It was *not* related to any changes made in 4.0.4, but rather, an old legacy bug in call_user_function*() Zeev At 15:07 11/12/2000, Thies C. Arntzen wrote:
    hi, just fixed a bug in serialize and found out that it
    reports leaks which are unrelated to my fix, but have more to
    do with passing objects to functions.
    i'm sure it didn't use to do that.
    coments?
    tc
<? class a { var $a=1; var $b; function __sleep() { return array("a","b"); } } $a = new a; var_dump($a); $b = serialize($a); // serialize uses call_user_function() to call __sleep() in $a /* if the above line reads: $b = serialize(&$a); we get no leak. */ ?> output is: ../../php4/Zend/zend_hash.c(291) : Freeing 0x081D55C4 (37 bytes), script=../sleep.php ../../php4/Zend/zend_hash.c(202) : Freeing 0x0818D3BC (20 bytes), script=../sleep.php ../../php4/Zend/zend_execute.h(188) : Freeing 0x081D5564 (48 bytes), script=../sleep.php ../../php4/Zend/zend_variables.c(150) : Actual location (location was relayed) ../../php4/Zend/zend_execute.h(185) : Freeing 0x081D54CC (12 bytes), script=../sleep.php ../../php4/Zend/zend_compile.c(1603) : Freeing 0x081D4DDC (12 bytes), script=../sleep.php -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> CTO, Zend Technologies Ltd. http://www.zend.com/

« previous php.dev (#41245) next »