Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:517 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71385 invoked from network); 30 Mar 2003 21:34:45 -0000 Received: from unknown (HELO mail.digarc.com) (216.204.113.51) by pb1.pair.com with SMTP; 30 Mar 2003 21:34:45 -0000 Received: from ctd01 (dsta-aa203.pivot.net [66.186.171.203]) by mail.digarc.com (8.11.6/8.11.2) with SMTP id h2UNJLE10617 for ; Sun, 30 Mar 2003 18:19:21 -0500 Message-ID: <004001c2f704$ceee0370$06dea8c0@cyberware.local> To: "php-dev" References: <1048001497.1516.3.camel@localhost.localdomain> <001901c2ed6f$b3be6f70$0301a8c0@TRABAJOS2> <016701c2f156$f6d83080$06dea8c0@cyberware.local> Date: Sun, 30 Mar 2003 16:34:36 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Subject: modules and registering destructors From: rrichards@digarc.com ("Rob Richards") My questions for the other day seem a lot off. After going through modules much more, I need someone to either confirm or explain a little more on how resources within a module are destroyed. What I am seeing stepping through the code is the following: a module loaded from the ini file destroys its resources in the reverse order that they are created via the script. a module loaded from a dl command destroys resources in the order that they are registered in the PHP_MINIT_FUNCTION via zend_register_list_destructors_ex. The memory leaks I seem to be seeing then would be due to the fact that there are some dependencies on the resource destructions, which would mean that the destructors would need to be defined in the order they should be destroyed in (to support loading via dl). Is correct? If not can someone shed a little more light on this? The problem I am stepping through is in the domxml. php_free_xml_doc is the first destructor registered, so when the extension is loaded via the dl command, php_free_xml_doc is the first destructor called, leaving the other resources (node references, etc..) which were created in the script to crash when they get called to be destroyed since xmlFreeDoc was already called. Any info on how the destructors work in the 2 different scenarios would be greatly helpful. Thanks, Rob