summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>1999-08-19 16:52:53 +0000
committerAndi Gutmans <andi@php.net>1999-08-19 16:52:53 +0000
commitaeec4e198a348ab782d2c3dd543218e849b27299 (patch)
tree5a547cff6b34e3b80d2bfe4b7715c2ce0a8c48ac
parente5fbf4414a1026aa14543eb64634c223e0431969 (diff)
downloadphp-git-aeec4e198a348ab782d2c3dd543218e849b27299.tar.gz
- Fixed memory leaks. tsrm resource id deallocation still needs to be implemented.
-rw-r--r--ext/pcre/php_pcre.c2
-rw-r--r--ext/standard/dir.c1
-rw-r--r--main/main.c8
3 files changed, 7 insertions, 4 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index ab696ad301..f11959df7e 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -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;
}
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 4ea03c2ecb..dc5705913b 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -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}
};
diff --git a/main/main.c b/main/main.c
index ed599f9742..0d0f136f21 100644
--- a/main/main.c
+++ b/main/main.c
@@ -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;