summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/tclWinThrd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index 7abcc29..86ff6a5 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -161,13 +161,20 @@ TclWinThreadStart(
{
WinThread *winThreadPtr = (WinThread *) lpParameter;
unsigned int fpmask = _MCW_EM | _MCW_RC | _MCW_PC | _MCW_DN;
+ LPTHREAD_START_ROUTINE lpOrigStartAddress;
+ LPVOID lpOrigParameter;
if (!winThreadPtr) {
return TCL_ERROR;
}
_controlfp(winThreadPtr->fpControl, fpmask);
- return winThreadPtr->lpStartAddress(winThreadPtr->lpParameter);
+
+ lpOrigStartAddress = winThreadPtr->lpStartAddress;
+ lpOrigParameter = winThreadPtr->lpParameter;
+
+ ckfree((char *)winThreadPtr);
+ return lpOrigStartAddress(lpOrigParameter);
}
/*