summaryrefslogtreecommitdiffstats
path: root/win/tkWinScrlbr.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-01-13 02:07:27 (GMT)
committerhobbs <hobbs>2000-01-13 02:07:27 (GMT)
commitc8e25bf9850c6cd3ef37fcfad7e24355c4687897 (patch)
treea16f05f36c7d0e764b5bd591735e14534b45834f /win/tkWinScrlbr.c
parentda329e27654313678d3523ce21cbe354f7236bd3 (diff)
downloadtk-c8e25bf9850c6cd3ef37fcfad7e24355c4687897.zip
tk-c8e25bf9850c6cd3ef37fcfad7e24355c4687897.tar.gz
tk-c8e25bf9850c6cd3ef37fcfad7e24355c4687897.tar.bz2
* win/tkWinScrlbr.c: added check for valid hwnd in ModalLoopProc
to avoid crash when building statically
Diffstat (limited to 'win/tkWinScrlbr.c')
-rw-r--r--win/tkWinScrlbr.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c
index e81e77c..f888679 100644
--- a/win/tkWinScrlbr.c
+++ b/win/tkWinScrlbr.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinScrlbr.c,v 1.3 1999/04/16 01:51:53 stanton Exp $
+ * RCS: @(#) $Id: tkWinScrlbr.c,v 1.4 2000/01/13 02:07:27 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -672,16 +672,18 @@ ModalLoopProc(tkwin, eventPtr)
WinScrollbar *scrollPtr = (WinScrollbar *) winPtr->instanceData;
int oldMode;
- Tcl_Preserve((ClientData)scrollPtr);
- scrollPtr->winFlags |= IN_MODAL_LOOP;
- oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
- TkWinResendEvent(scrollPtr->oldProc, scrollPtr->hwnd, eventPtr);
- (void) Tcl_SetServiceMode(oldMode);
- scrollPtr->winFlags &= ~IN_MODAL_LOOP;
- if (scrollPtr->hwnd && scrollPtr->winFlags & ALREADY_DEAD) {
- DestroyWindow(scrollPtr->hwnd);
+ if (scrollPtr->hwnd) {
+ Tcl_Preserve((ClientData)scrollPtr);
+ scrollPtr->winFlags |= IN_MODAL_LOOP;
+ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ TkWinResendEvent(scrollPtr->oldProc, scrollPtr->hwnd, eventPtr);
+ (void) Tcl_SetServiceMode(oldMode);
+ scrollPtr->winFlags &= ~IN_MODAL_LOOP;
+ if (scrollPtr->hwnd && scrollPtr->winFlags & ALREADY_DEAD) {
+ DestroyWindow(scrollPtr->hwnd);
+ }
+ Tcl_Release((ClientData)scrollPtr);
}
- Tcl_Release((ClientData)scrollPtr);
}
/*