diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2012-09-13 18:37:55 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2012-09-13 18:37:55 (GMT) |
commit | 3bb8b9504c9b66c9bc3ac72103318b107f20184a (patch) | |
tree | 9964c2577c5d9d5c20a943e5e088dfd810d37859 /win | |
parent | 2aaae6b3fed6fda7473eb417e366fc2e57cd3a5d (diff) | |
download | tcl-3bb8b9504c9b66c9bc3ac72103318b107f20184a.zip tcl-3bb8b9504c9b66c9bc3ac72103318b107f20184a.tar.gz tcl-3bb8b9504c9b66c9bc3ac72103318b107f20184a.tar.bz2 |
Free the WinThread structure before running the original thread procedure.
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinThrd.c | 9 |
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); } /* |