summaryrefslogtreecommitdiffstats
path: root/win/tclWinThrd.c
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2012-09-13 18:37:55 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2012-09-13 18:37:55 (GMT)
commitc02b64e20cd435142d5924015fadc8dbcd19aa43 (patch)
tree9964c2577c5d9d5c20a943e5e088dfd810d37859 /win/tclWinThrd.c
parent77806ded9e45e9569f778847e63516f884788da2 (diff)
downloadtcl-c02b64e20cd435142d5924015fadc8dbcd19aa43.zip
tcl-c02b64e20cd435142d5924015fadc8dbcd19aa43.tar.gz
tcl-c02b64e20cd435142d5924015fadc8dbcd19aa43.tar.bz2
Free the WinThread structure before running the original thread procedure.
Diffstat (limited to 'win/tclWinThrd.c')
-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);
}
/*