Attachment "0001-Bug-3205260-avoid-crash-in-wm-manage-of-children-wit.patch" to
ticket [3205260f]
added by
patthoyts
2011-03-10 19:52:19.
From 72775f9a36b5399022454730f29781fca3960cc2 Mon Sep 17 00:00:00 2001
From: Pat Thoyts <[email protected]>
Date: Thu, 10 Mar 2011 11:18:58 +0000
Subject: [PATCH] [Bug 3205260] avoid crash in wm manage of children with null class
The tkhtml widget doesn't set it's window class. The Windows implementation
of the wm manage command checks to see if the contained window is actually
a menu (looking for torn-off menus) by examining the class. This patch
adds a check for a null class to avoid crashing as suggested.
Suggested-by: Eric Boudaillier <[email protected]>
Signed-off-by: Pat Thoyts <[email protected]>
---
win/tkWinWm.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 94c8bb8..6b151cb 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -8545,12 +8545,13 @@ RemapWindows(
HWND parentHWND)
{
TkWindow *childPtr;
+ const char *className = Tk_Class(winPtr);
/*
* Skip menus as they are handled differently.
*/
- if (strcmp(Tk_Class(winPtr), "Menu") == 0) {
+ if (className != NULL && strcmp(className, "Menu") == 0) {
return;
}
if (winPtr->window) {
--
1.7.4.msysgit.0