summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2003-12-14 09:36:23 (GMT)
committerZeev Suraski <zeev@php.net>2003-12-14 09:36:23 (GMT)
commit3788ddb383d1edc42afbebde25795d598ed92b23 (patch)
treecb47b9f62988bc03f5b86d2c1302a98d3d990951 /TSRM
parent95cb88e5d043ca657bbd790e0e65e57e7b01e935 (diff)
downloadphp-3788ddb383d1edc42afbebde25795d598ed92b23.tar.gz
Fix from Michael Sisolak (destructors weren't always properly called)
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/TSRM.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index ebb0acb..a47cfac 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -157,7 +157,12 @@ TSRM_API void tsrm_shutdown(void)
int j;
next_p = p->next;
- for (j=0; j<id_count; j++) {
+ for (j=0; j<p->count; j++) {
+ if (resource_types_table[j].dtor) {
+ resource_types_table[j].dtor(p->storage[j], &p->storage);
+ }
+ }
+ for (j=0; j<p->count; j++) {
if (resource_types_table && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j], &p->storage);
}