diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinScrlbr.c | 22 |
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); } /* |