From a86e9689dfb969690dc1fcdcdde22506e5b4b94b Mon Sep 17 00:00:00 2001 From: tron Date: Fri, 5 Aug 2005 08:24:12 +0000 Subject: (svn r2807) Fix two major bugs in the threaded save code: - Do not dereference a local variable which no longer exists; this lead to random crashes when saving - (Win32) Do not close a handle before it is used last There are still many major problems (race conditions and resulting memory corruption/crashes) left --- win32.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'win32.c') diff --git a/win32.c b/win32.c index ffd1754c0..f4857a075 100644 --- a/win32.c +++ b/win32.c @@ -1204,16 +1204,12 @@ bool CreateOTTDThread(void *func, void *param) return hThread != NULL; } -void CloseOTTDThread(void) -{ - if (!CloseHandle(hThread)) DEBUG(misc, 0) ("Failed to close thread?..."); -} - void JoinOTTDThread(void) { if (hThread == NULL) return; WaitForSingleObject(hThread, INFINITE); + if (!CloseHandle(hThread)) DEBUG(misc, 0) ("Failed to close thread handle!"); } -- cgit v1.2.3-70-g09d2