]> granicus.if.org Git - php/commitdiff
- Once ts_free_id() will be used, we cannot call ctors for deleted ids
authorMarcus Boerger <helly@php.net>
Thu, 13 May 2004 06:53:21 +0000 (06:53 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 13 May 2004 06:53:21 +0000 (06:53 +0000)
  when creating new threads.

TSRM/TSRM.c

index 3369c5e69bad8c2604db1728e10418dfa6b9469f..b107dcc543ddb1feb21755c9de801c402bf71de5 100644 (file)
@@ -283,9 +283,16 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
                tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage));
        }
        for (i=0; i<id_count; i++) {
-               (*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
-               if (resource_types_table[i].ctor) {
-                       resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage);
+#if MBO_0
+               if (resource_types_table[i].done) {
+                       thread_resources_ptr)->storage[i] = NULL;
+               } else
+#endif
+               {
+                       (*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
+                       if (resource_types_table[i].ctor) {
+                               resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage);
+                       }
                }
        }