Date: 04/30/99
- Next message: thies: "[PHP-DEV] CVS update: php3/functions"
- Previous message: Thies C. Arntzen: "[PHP-DEV] cleanups (destructors-functions MUST return a value)"
- In reply to: Thies C. Arntzen: "[PHP-DEV] cleanups (destructors-functions MUST return a value)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 30 Apr 1999, Thies C. Arntzen wrote:
> currently working on one of the sporadic crashes when using ora_**
> calls.... (i'm sure there's more stuff like this in some other modules)...
>
>
> 1. is it right that ALL descructor functions don't need a to return a
> value (stuff that gets registred with register_descructior)?? -> 'cause
> hash_destroy will be called for them....
It's true.
> 2. if you call _php3_hash_apply the supplied function MUST return a
> value (not sure if this is the case in all current modules!!!)
That's also true. The function pointer supplied to hash_apply is expected
to return an int. If the return value is true, after running the function
on the element, that element is also destroyed (if there's a registered
destructor function for it, it *WILL* be called, so your apply-function
mustn't destroy it as well!)
> 3. you should NOT call _php3_hash_apply on the same HashTable if you're
> already in the descructor function for that table!!!
Absolutely true, any resource you register in a hash table (in that case,
the resource list table) that has a destructor - must never be explicitly
destructed by you, since sooner or later, it will be destructed when the
hash is destroyed.
> question: how can i influence the order in which HashTables get destructed
> (cursors BEFORE connections etc) in a save way -> the way it's currently
> done is NOT save as we can see from the gdb-trace!!
There's no way you can influence the order in which elements in the hash
are destroyed, after all, it is a hash :)
Your only option is registering just the 'absolute parent' in the resource
list, and putting all the necessary pointers to any related children in
that parent, so the parent's destructor can destroy them in the right
order.
Zeev
-- ----------------------------------------------------- Zeev Suraski <zeev <email protected>> For a PGP public key, finger bourbon <email protected>-- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe <email protected> For help: php-dev-help <email protected>
- Next message: thies: "[PHP-DEV] CVS update: php3/functions"
- Previous message: Thies C. Arntzen: "[PHP-DEV] cleanups (destructors-functions MUST return a value)"
- In reply to: Thies C. Arntzen: "[PHP-DEV] cleanups (destructors-functions MUST return a value)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

