ID:               25541
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ich at christoph-emonds dot de
-Status:           Verified
+Status:           Closed
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5CVS-2004-01-27
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2004-01-11 11:02:02] [EMAIL PROTECTED]

Construct A!Construct B!
/usr/src/web/php/php5/Zend/zend_hash.c(301) :  Freeing 0x40E4B9F4 (41
bytes), script=t.php
Last leak repeated 1 time
/usr/src/web/php/php5/Zend/zend_execute.c(3095) :  Freeing 0x40E4B7D4
(44 bytes), script=t.php
/usr/src/web/php/php5/Zend/zend_API.c(720) : Actual location (location
was relayed)
Last leak repeated 1 time
/usr/src/web/php/php5/Zend/zend_objects.c(88) :  Freeing 0x40E4B790 (12
bytes), script=t.php
Last leak repeated 1 time
/usr/src/web/php/php5/Zend/zend_execute.c(3094) :  Freeing 0x40E4B74C
(16 bytes), script=t.php
Last leak repeated 1 time
/usr/src/web/php/php5/Zend/zend_API.c(721) :  Freeing 0x40E4B3EC (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 ===


------------------------------------------------------------------------

[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

Reply via email to