]> granicus.if.org Git - php/commitdiff
Repositioned CoInitialize and CoUninitialize that apparetly makes it more
authorIlia Alshanetsky <iliaa@php.net>
Mon, 2 Dec 2002 06:43:54 +0000 (06:43 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 2 Dec 2002 06:43:54 +0000 (06:43 +0000)
correct according to MS docs. Patch (+5) by Michael Sisolak
<msisolak@yahoo.com>.

ext/standard/basic_functions.c

index dde522db331f43ed55cb8431ae0ad5daee95233b..d5fbe42742291997611b57acec15e738a115ed7e 100644 (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;
 }