From 39c3481a9c6ebe4e8a52f2cf5b41df6b6ab8a834 Mon Sep 17 00:00:00 2001 From: Garrett Brown Date: Tue, 25 Jun 2024 20:53:36 -0700 Subject: Python: Restore close of WindowXML when application exits --- xbmc/interfaces/legacy/Window.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/xbmc/interfaces/legacy/Window.cpp b/xbmc/interfaces/legacy/Window.cpp index 05b6b74530..5107645cf6 100644 --- a/xbmc/interfaces/legacy/Window.cpp +++ b/xbmc/interfaces/legacy/Window.cpp @@ -668,16 +668,6 @@ namespace XBMCAddon while (bModal && !g_application.m_bStop) { -//! @todo garbear added this code to the python window.cpp class and -//! commented in XBPyThread.cpp. I'm not sure how to handle this -//! in this native implementation. -// // Check if XBPyThread::stop() raised a SystemExit exception -// if (PyThreadState_Get()->async_exc == PyExc_SystemExit) -// { -// CLog::Log(LOGDEBUG, "PYTHON: doModal() encountered a SystemExit exception, closing window and returning"); -// Window_Close(self, NULL); -// break; -// } languageHook->MakePendingCalls(); // MakePendingCalls bool stillWaiting; @@ -687,6 +677,14 @@ namespace XBMCAddon DelayedCallGuard dcguard(languageHook); stillWaiting = WaitForActionEvent(100) ? false : true; } + + // If application has quit, close the window + if (bModal && g_application.m_bStop) + { + CLog::Log(LOGDEBUG, "PYTHON: Application quit inside doModal(), closing window"); + close(); + } + languageHook->MakePendingCalls(); } while (stillWaiting); } -- cgit v1.2.3