Improve robustness: Make sure we don't act on window events for

windows that no longer exists. (This shouldn't happen with the current
code base, but will be a problem when multiple main windows and
created and destroyed through the process lifetime.)



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1546 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2010-01-13 14:53:43 +00:00
parent ea2bdbc96b
commit 9a926834ff

5
xwin.c
View File

@ -2158,6 +2158,7 @@ ui_destroy_window(void)
XDestroyIC(g_IC); XDestroyIC(g_IC);
XDestroyWindow(g_display, g_wnd); XDestroyWindow(g_display, g_wnd);
g_wnd = NULL;
} }
void void
@ -2294,6 +2295,10 @@ xwin_process_events(void)
{ {
XNextEvent(g_display, &xevent); XNextEvent(g_display, &xevent);
if (g_wnd == NULL)
/* Ignore events between ui_destroy_window and ui_create_window */
continue;
if ((g_IC != NULL) && (XFilterEvent(&xevent, None) == True)) if ((g_IC != NULL) && (XFilterEvent(&xevent, None) == True))
{ {
DEBUG_KBD(("Filtering event\n")); DEBUG_KBD(("Filtering event\n"));