]> granicus.if.org Git - php/commitdiff
- Fixed memory leaks. tsrm resource id deallocation still needs to be implemented.
authorAndi Gutmans <andi@php.net>
Thu, 19 Aug 1999 16:52:53 +0000 (16:52 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 19 Aug 1999 16:52:53 +0000 (16:52 +0000)
ext/pcre/php_pcre.c
ext/standard/dir.c
main/main.c

index ab696ad3018f75375afdbbe4deaacf80c500a21b..f11959df7e82e1a0ef4022cd0f300d31cf8ee17b 100644 (file)
@@ -136,6 +136,8 @@ int php_mshutdown_pcre(SHUTDOWN_FUNC_ARGS)
 {
 #ifndef ZTS
        zend_hash_destroy(&PCRE_G(pcre_cache));
+#else
+       ts_free_id(pcre_globals_id);
 #endif
        return SUCCESS;
 }
index 4ea03c2ecb6001b7b7934f80868f274d8b415ae5..dc5705913b017ceaf1a0643ee9ddf69fc525dbe1 100644 (file)
@@ -59,6 +59,7 @@ static zend_function_entry php_dir_class_functions[] = {
        PHP_FALIAS(close,       closedir,       NULL)
        PHP_FALIAS(rewind,      rewinddir,      NULL)
        PHP_FALIAS(read,        readdir,        NULL)
+       {NULL, NULL, NULL}
 };
 
 
index ed599f97424e7e346073b6c56f9bc0c5b11a1551..0d0f136f2121f749e3aacaea22878d0be542d298 100644 (file)
@@ -771,6 +771,7 @@ int php_module_startup(sapi_module_struct *sf)
        zend_utility_values zuv;
        int module_number=0;    /* for REGISTER_INI_ENTRIES() */
 #ifdef ZTS
+       zend_executor_globals *executor_globals;
        php_core_globals *core_globals;
        sapi_globals_struct *sapi_globals = ts_resource(sapi_globals_id);
 #endif
@@ -778,7 +779,6 @@ int php_module_startup(sapi_module_struct *sf)
        WORD wVersionRequested = MAKEWORD(2, 0);
        WSADATA wsaData;
 #endif
-       ELS_FETCH();
 
        SG(server_context) = NULL;
        SG(request_info).request_method = NULL;
@@ -788,8 +788,6 @@ int php_module_startup(sapi_module_struct *sf)
                return SUCCESS;
        }
 
-       EG(error_reporting) = E_ALL & ~E_NOTICE;
-       
        sapi_module = *sf;
 
        zend_output_startup();
@@ -806,10 +804,12 @@ int php_module_startup(sapi_module_struct *sf)
 
 #ifdef ZTS
        tsrm_set_new_thread_end_handler(php_new_thread_end_handler);
+       executor_globals = ts_resource(executor_globals_id);
        core_globals_id = ts_allocate_id(sizeof(php_core_globals), NULL, NULL);
        core_globals = ts_resource(core_globals_id);
 #endif
-
+       EG(error_reporting) = E_ALL & ~E_NOTICE;
+       
        PG(header_is_being_sent) = 0;
        SG(request_info).headers_only = 0;