From a3703410046da03d85aa4594af1bc82c8255de48 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Thu, 10 Mar 2011 15:27:35 +0000 Subject: [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 Signed-off-by: Pat Thoyts --- win/tkWinWm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 67c2a6e..290fe3e 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -8635,9 +8635,10 @@ RemapWindows(winPtr, parentHWND) 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) { -- cgit v0.12