summaryrefslogtreecommitdiffstats
path: root/win/tkWinScrlbr.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-01-13 02:07:27 (GMT)
committerhobbs <hobbs@noemail.net>2000-01-13 02:07:27 (GMT)
commit96230f4b03b321e99f140740f28a7999c63b7fdf (patch)
treea16f05f36c7d0e764b5bd591735e14534b45834f /win/tkWinScrlbr.c
parent0ce5bdf4dc3abbdb9566eda16a347f988d816b27 (diff)
downloadtk-96230f4b03b321e99f140740f28a7999c63b7fdf.zip
tk-96230f4b03b321e99f140740f28a7999c63b7fdf.tar.gz
tk-96230f4b03b321e99f140740f28a7999c63b7fdf.tar.bz2
* win/tkWinScrlbr.c: added check for valid hwnd in ModalLoopProc
to avoid crash when building statically FossilOrigin-Name: 5f3e690021d3afded504ae9ff30d98c409028617
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);
}
/*