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



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to