From 36b9b4b39900d1b2e3b182e1b50370b0c9dcb9ae Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 24 Jun 2014 12:45:21 +0200 Subject: Change allocation of ThreadData to be physically part of the object containing it --- src/threadengines/threadengine_win32.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/threadengines/threadengine_win32.cpp') diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp index 77f638f37..3376f937a 100644 --- a/src/threadengines/threadengine_win32.cpp +++ b/src/threadengines/threadengine_win32.cpp @@ -23,17 +23,12 @@ void ThreadEngine::Start(Thread* thread) { - ThreadData* data = new ThreadData; - thread->state = data; - DWORD ThreadId = 0; - data->handle = CreateThread(NULL,0,ThreadEngine::Entry,thread,0,&ThreadId); + thread->state.handle = CreateThread(NULL, 0, ThreadEngine::Entry, thread, 0, &ThreadId); - if (data->handle == NULL) + if (thread->state.handle == NULL) { DWORD lasterr = GetLastError(); - thread->state = NULL; - delete data; std::string err = "Unable to create new thread: " + ConvToStr(lasterr); SetLastError(ERROR_SUCCESS); throw CoreException(err); -- cgit v1.3.1-10-gc9f91