]> granicus.if.org Git - php/commitdiff
Fixed bug #35612 (iis6 Access Violation crash)
authorDmitry Stogov <dmitry@php.net>
Fri, 9 Dec 2005 18:10:45 +0000 (18:10 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 9 Dec 2005 18:10:45 +0000 (18:10 +0000)
NEWS
Zend/zend_execute_API.c

diff --git a/NEWS b/NEWS
index bca89ff4bb28471c87ebcd37ef7f2f9f4686abfa..6f7b7c64ccea6913eb254c75f2992a6b8906090b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ PHP                                                                        NEWS
 - Fixed many bugs in OCI8. (Tony)
 - Fixed crash and leak in mysqli when using 4.1.x client libraries and
   connecting to 5.x server. (Andrey)
+- Fixed bug #35612 (iis6 Access Violation crash). (Dmitry, alacn.uhahaa)
 - Fixed bug #35594 (Multiple calls to getopt() may result in a crash).
   (rabbitt at gmail dot com, Ilia)
 - Fixed bug #35558 (mktime() interpreting 3 digit years incorrectly). (Ilia)
index c0d585d835fa25fd3bb334092c8cc5905937508e..865f56699434744cda4d165ddb0ed30bc887ac28 100644 (file)
@@ -46,6 +46,7 @@ ZEND_API zend_fcall_info_cache empty_fcall_info_cache = { 0, NULL, NULL, NULL };
 static WNDCLASS wc;
 static HWND timeout_window;
 static HANDLE timeout_thread_event;
+static HANDLE timeout_thread_handle;
 static DWORD timeout_thread_id;
 static int timeout_thread_initialized=0;
 #endif
@@ -1254,7 +1255,7 @@ static unsigned __stdcall timeout_thread_proc(void *pArgs)
 void zend_init_timeout_thread()
 {
        timeout_thread_event = CreateEvent(NULL, FALSE, FALSE, NULL);
-       _beginthreadex(NULL, 0, timeout_thread_proc, NULL, 0, &timeout_thread_id);
+       timeout_thread_handle = _beginthreadex(NULL, 0, timeout_thread_proc, NULL, 0, &timeout_thread_id);
        WaitForSingleObject(timeout_thread_event, INFINITE);
 }
 
@@ -1265,6 +1266,10 @@ void zend_shutdown_timeout_thread()
                return;
        }
        PostThreadMessage(timeout_thread_id, WM_QUIT, 0, 0);
+
+       /* Wait for thread termination */
+       WaitForSingleObject(timeout_thread_handle, 5000);
+       CloseHandle(timeout_thread_handle);
 }
 
 #endif