Repositioned CoInitialize and CoUninitialize that apparetly makes it more

correct according to MS docs. Patch (+5) by Michael Sisolak
<msisolak@yahoo.com>.
This commit is contained in:
Ilia Alshanetsky 2002-12-02 06:43:54 +00:00
parent a6e02dc45d
commit 057e87e6e5

View File

@ -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;
}