From 20c15003f9648de0c03f7d4fa4508afd896b19f5 Mon Sep 17 00:00:00 2001 From: Alexander Gottwald Date: Tue, 5 Jul 2005 18:25:44 +0000 Subject: [PATCH] Fix crash on server shutdown --- hw/xwin/ChangeLog | 5 +++++ hw/xwin/winmultiwindowwm.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog index 6d06412d2..93da0323a 100644 --- a/hw/xwin/ChangeLog +++ b/hw/xwin/ChangeLog @@ -1,3 +1,8 @@ +2005-07-05 Alexander Gottwald + + * winmultiwindowwm.c: + Fix crash on server shutdown + 2005-07-05 Alexander Gottwald * winkeybd.c: diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 3727474e9..03f179345 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -981,6 +981,9 @@ winMultiWindowXMsgProc (void *pArg) /* Loop until we explicitly break out */ while (1) { + if (g_shutdown) + break; + if (pProcArg->pWMInfo->fAllowOtherWM && !XPending (pProcArg->pDisplay)) { if (CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen)) @@ -1061,6 +1064,10 @@ winMultiWindowXMsgProc (void *pArg) winSendMessageToWM (pProcArg->pWMInfo, &msg); } } + + XCloseDisplay (pProcArg->pDisplay); + pthread_exit (NULL); + } @@ -1338,6 +1345,9 @@ winMultiWindowWMIOErrorHandler (Display *pDisplay) { ErrorF ("\nwinMultiWindowWMIOErrorHandler!\n\n"); + if (g_shutdown) + pthread_exit(NULL); + /* Restart at the main entry point */ longjmp (g_jmpWMEntry, WIN_JMP_ERROR_IO);