aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Brown <themagnificentmrb@gmail.com>2024-06-27 15:02:12 -0700
committerGitHub <noreply@github.com>2024-06-27 15:02:12 -0700
commit253db04ded8b13ef8c610fcd4a4d4109cff27236 (patch)
treea1537b011896a7d6e2cf096aa0537f46b2791d4b
parent501ec1fae0fb86760548018f02702a9caf8ba997 (diff)
parent39c3481a9c6ebe4e8a52f2cf5b41df6b6ab8a834 (diff)
Merge pull request #25380 from garbear/close-windowxml
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);
}