From c351588bba209116d00985b1b67e5a0bdb52dd06 Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Fri, 28 Oct 2016 08:22:36 +0800 Subject: [PATCH] Remove use of window_exists in newmenu_handler Replace with a disabled check for window_event_result::deleted, which will be enabled when all newmenu subfunctions return a window_event_result. There are currently no instances of a subfunction closing the window itself (which is preferred). --- similar/main/newmenu.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/similar/main/newmenu.cpp b/similar/main/newmenu.cpp index b4bec4f1c..dd3b692f6 100644 --- a/similar/main/newmenu.cpp +++ b/similar/main/newmenu.cpp @@ -1512,8 +1512,11 @@ static window_event_result newmenu_handler(window *wind,const d_event &event, ne { int rval = (*menu->subfunction)(menu, event, menu->userdata); - if (!window_exists(wind)) - return window_event_result::handled; // some subfunction closed the window: bail! +#if 0 // No current instances of the subfunction closing the window itself (which is preferred) + // Enable when all subfunctions return a window_event_result + if (rval == window_event_result::deleted) + return rval; // some subfunction closed the window: bail! +#endif if (rval) {