]> granicus.if.org Git - php/commitdiff
ilia pointet me to a thread on php-dev saying that
authorHarald Radi <phanto@php.net>
Wed, 29 Jan 2003 00:46:31 +0000 (00:46 +0000)
committerHarald Radi <phanto@php.net>
Wed, 29 Jan 2003 00:46:31 +0000 (00:46 +0000)
Co(Un)Initialize should be called per thread

main/main.c

index a5415425d8dfb250cc77c26c8407d2bdf3e4f752..d4a58e134674e68227c947176cc72f8138768cdc 100644 (file)
@@ -841,6 +841,10 @@ int php_request_startup(TSRMLS_D)
 {
        int retval = SUCCESS;
 
+#ifdef PHP_WIN32
+       CoInitialize(NULL);
+#endif
+
 #if PHP_SIGCHILD
        signal(SIGCHLD, sigchld_handler);
 #endif
@@ -952,6 +956,10 @@ void php_request_shutdown(void *dummy)
        zend_try { 
                zend_unset_timeout(TSRMLS_C);
        } zend_end_try();
+
+#ifdef PHP_WIN32
+       CoUninitialize();
+#endif
 }
 /* }}} */
 
@@ -1015,8 +1023,6 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
        WSADATA wsaData;
 #endif
 #ifdef PHP_WIN32
-       CoInitialize(NULL);
-
        {
                DWORD dwVersion = GetVersion();
 
@@ -1236,10 +1242,6 @@ void php_module_shutdown(TSRMLS_D)
 #endif
 
        module_initialized = 0;
-       
-#ifdef PHP_WIN32
-       CoUninitialize();
-#endif
 }
 /* }}} */