From: Ilia Alshanetsky Date: Mon, 2 Dec 2002 06:43:54 +0000 (+0000) Subject: Repositioned CoInitialize and CoUninitialize that apparetly makes it more X-Git-Tag: RELEASE_1_0b3~206 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=057e87e6e55e2e6d5604254d9b02e22d0852b40d;p=php Repositioned CoInitialize and CoUninitialize that apparetly makes it more correct according to MS docs. Patch (+5) by Michael Sisolak . --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index dde522db33..d5fbe42742 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -966,10 +966,6 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) memset(&BG(url_adapt_state), 0, sizeof(BG(url_adapt_state))); memset(&BG(url_adapt_state_ex), 0, sizeof(BG(url_adapt_state_ex))); -#ifdef PHP_WIN32 - CoInitialize(NULL); -#endif - BG(incomplete_class) = php_create_incomplete_class(TSRMLS_C); } @@ -980,9 +976,6 @@ static void basic_globals_dtor(php_basic_globals *basic_globals_p TSRMLS_DC) if (BG(sm_allowed_env_vars)) { free(BG(sm_allowed_env_vars)); } -#ifdef PHP_WIN32 - CoUninitialize(); -#endif } @@ -1115,6 +1108,10 @@ PHP_MSHUTDOWN_FUNCTION(basic) PHP_RINIT_FUNCTION(basic) { +#ifdef PHP_WIN32 + CoInitialize(NULL); +#endif + memset(BG(strtok_table), 0, 256); BG(strtok_string) = NULL; BG(strtok_zval) = NULL; @@ -1197,6 +1194,10 @@ PHP_RSHUTDOWN_FUNCTION(basic) } #endif +#ifdef PHP_WIN32 + CoUninitialize(); +#endif + return SUCCESS; }