aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Brown <themagnificentmrb@gmail.com>2024-06-25 20:53:36 -0700
committerGarrett Brown <themagnificentmrb@gmail.com>2024-06-25 21:48:08 -0700
commit39c3481a9c6ebe4e8a52f2cf5b41df6b6ab8a834 (patch)
tree2392063931404bb8a00866bf83bbd3c82d979233
parent433684672e645837c2741c0f6790333bced2c041 (diff)
Python: Restore close of WindowXML when application exits
-rw-r--r--xbmc/interfaces/legacy/Window.cpp18
1 files 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);
}