ID: 25541 Updated by: [EMAIL PROTECTED] Reported By: ich at christoph-emonds dot de -Status: Open +Status: Verified Bug Type: Zend Engine 2 problem Operating System: Gentoo Linux 2.4.20 -PHP Version: 5CVS-2003-09-15 (dev) +PHP Version: 5CVS-2003-11-18 (dev) New Comment:
Construct A! Construct B! /usr/src/web/php/php5/Zend/zend_hash.c(236) : Freeing 0x40E45A98 (41 bytes), script=t.php Last leak repeated 1 time /usr/src/web/php/php5/Zend/zend_execute.c(3098) : Freeing 0x40E45A34 (44 bytes), script=t.php /usr/src/web/php/php5/Zend/zend_API.c(713) : Actual location (location was relayed) Last leak repeated 1 time /usr/src/web/php/php5/Zend/zend_objects.c(106) : Freeing 0x40E459F0 (12 bytes), script=t.php Last leak repeated 1 time /usr/src/web/php/php5/Zend/zend_execute.c(3097) : Freeing 0x40E459AC (16 bytes), script=t.php Last leak repeated 1 time /usr/src/web/php/php5/Zend/zend_API.c(714) : Freeing 0x40E455E8 (32 bytes), script=t.php /usr/src/web/php/php5/Zend/zend_hash.c(157) : Actual location (location was relayed) Last leak repeated 1 time === Total 10 memory leaks detected === Previous Comments: ------------------------------------------------------------------------ [2003-09-15 06:35:27] ich at christoph-emonds dot de Description: ------------ If you create two objects which contain a reference to the other object, none of both __destruct() functions will be called. Configure: './configure' '--with-mysql' '--with-xsl' '--with-sqlite' '--enable-sockets' '--with-mysql-sock' '--with-gd' '--with-dom' '--with-apxs2=/usr/sbin/apxs2' '--with-zlib' Reproduce code: --------------- class A { function __construct() { print "Construct A!"; $this->other = new B( $this ); } function __destruct() { print "Destruct A!"; } } class B { function __construct( A $obj ) { print "Construct B!"; $this->other = $obj; } function __destruct() { print "Destruct B!"; } } new A(); Expected result: ---------------- Construct A!Construct B!Destruct A!Destruct B! Actual result: -------------- Construct A!Construct B! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25541&edit=1