|
@@ -267,7 +267,10 @@ int Thread::begin()
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
if (threadTerminationHook)
|
|
if (threadTerminationHook)
|
|
|
|
+ {
|
|
(*threadTerminationHook)();
|
|
(*threadTerminationHook)();
|
|
|
|
+ threadTerminationHook = NULL;
|
|
|
|
+ }
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
#ifndef _DEBUG
|
|
#ifndef _DEBUG
|
|
CloseHandle(hThread); // leak handle when debugging,
|
|
CloseHandle(hThread); // leak handle when debugging,
|
|
@@ -809,7 +812,10 @@ public:
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
if (threadTerminationHook)
|
|
if (threadTerminationHook)
|
|
|
|
+ {
|
|
(*threadTerminationHook)(); // Reset any pre-thread state.
|
|
(*threadTerminationHook)(); // Reset any pre-thread state.
|
|
|
|
+ threadTerminationHook = NULL;
|
|
|
|
+ }
|
|
} while (parent.notifyStopped(this));
|
|
} while (parent.notifyStopped(this));
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|