diff options
author | Andi Gutmans <andi@php.net> | 2004-07-10 07:46:17 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2004-07-10 07:46:17 +0000 |
commit | e5cfb1d05cf10fa694f231dae33ccb03ab8f74c8 (patch) | |
tree | 65252174d1cad948046778306ce3ba09d3d78682 /ext/w32api/w32api.c | |
parent | 41b639fffebd099699cdf9c3231539d72602ce38 (diff) | |
download | php-git-e5cfb1d05cf10fa694f231dae33ccb03ab8f74c8.tar.gz |
- Better stability during premature shutdown of request startup
Diffstat (limited to 'ext/w32api/w32api.c')
-rw-r--r-- | ext/w32api/w32api.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/ext/w32api/w32api.c b/ext/w32api/w32api.c index 4dc52a86f5..b05b5449b7 100644 --- a/ext/w32api/w32api.c +++ b/ext/w32api/w32api.c @@ -287,20 +287,26 @@ PHP_MSHUTDOWN_FUNCTION(w32api) */ PHP_RINIT_FUNCTION(w32api) { + HashTable *tmp; + WG(funcs) = WG(libraries) = WG(callbacks) = WG(types) = NULL; + /* Allocate Request Specific HT's here */ - ALLOC_HASHTABLE(WG(funcs)); - zend_hash_init(WG(funcs), 1, NULL, php_w32api_hash_func_dtor, 1); - - ALLOC_HASHTABLE(WG(libraries)); - zend_hash_init(WG(libraries), 1, NULL, php_w32api_hash_lib_dtor, 1); + ALLOC_HASHTABLE(tmp); + zend_hash_init(tmp, 1, NULL, php_w32api_hash_func_dtor, 1); + WG(funcs) = tmp; - ALLOC_HASHTABLE(WG(callbacks)); - zend_hash_init(WG(callbacks), 1, NULL, php_w32api_hash_callback_dtor, 1); + ALLOC_HASHTABLE(tmp); + zend_hash_init(tmp, 1, NULL, php_w32api_hash_lib_dtor, 1); + WG(libraries) = tmp; - ALLOC_HASHTABLE(WG(types)); - zend_hash_init(WG(types), 1, NULL, php_w32api_hash_type_dtor, 1); + ALLOC_HASHTABLE(tmp); + zend_hash_init(tmp, 1, NULL, php_w32api_hash_callback_dtor, 1); + WG(callbacks) = tmp; + ALLOC_HASHTABLE(tmp); + zend_hash_init(tmp, 1, NULL, php_w32api_hash_type_dtor, 1); + WG(types) = tmp; return SUCCESS; @@ -327,6 +333,7 @@ PHP_RSHUTDOWN_FUNCTION(w32api) zend_hash_destroy(WG(types)); FREE_HASHTABLE(WG(types)); + WG(funcs) = WG(libraries) = WG(callbacks) = WG(types) = NULL; return SUCCESS; } |