src/thread_win32.cpp
branchnoai
changeset 10171 d4397d599d78
parent 9859 81621c6ba0e9
child 10172 f93d3b7df6c8
--- a/src/thread_win32.cpp	Sun Apr 13 09:10:59 2008 +0000
+++ b/src/thread_win32.cpp	Mon Apr 14 15:24:16 2008 +0000
@@ -29,8 +29,6 @@
 {
 	OTTDThread *t = MallocT<OTTDThread>(1);
 
-	if (t == NULL) return NULL;
-
 	t->func = function;
 	t->arg  = arg;
 	t->thread = (HANDLE)_beginthreadex(NULL, 0, Proxy, t, 0, &t->thread_id);
@@ -45,13 +43,11 @@
 
 void *OTTDJoinThread(OTTDThread *t)
 {
-	void *ret;
-
 	if (t == NULL) return NULL;
 
 	WaitForSingleObject(t->thread, INFINITE);
 	CloseHandle(t->thread);
-	ret = t->ret;
+	void *ret = t->ret;
 	free(t);
 	return ret;
 }