diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-01-04 07:26:32 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-01-04 07:26:32 +0000 |
commit | 809b8bcbe6c8762efc6e00eb78573de1e805963f (patch) | |
tree | 4b3ae0c845ee87a0d34469f0277e00803db6cbb5 /guilib/GUIDialog.cpp | |
parent | 5d6acf7e193c53ac7145d06a02b2d96c4f6fb256 (diff) |
fixed: Ticket #8361 - crash in some python scripts when closing dialogs
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26352 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIDialog.cpp')
-rw-r--r-- | guilib/GUIDialog.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/guilib/GUIDialog.cpp b/guilib/GUIDialog.cpp index da6f2fc57d..6ef696cfd4 100644 --- a/guilib/GUIDialog.cpp +++ b/guilib/GUIDialog.cpp @@ -108,7 +108,7 @@ bool CGUIDialog::OnMessage(CGUIMessage& message) return CGUIWindow::OnMessage(message); } -void CGUIDialog::Close(bool forceClose /*= false*/) +void CGUIDialog::Close_Internal(bool forceClose /*= false*/) { //Lock graphic context here as it is sometimes called from non rendering threads //maybe we should have a critical section per window instead?? @@ -199,6 +199,19 @@ void CGUIDialog::Show_Internal() // m_bRunning = true; } +void CGUIDialog::Close(bool forceClose /* = false */) +{ + if (!g_application.IsCurrentThread()) + { + // make sure graphics lock is not held + int nCount = ExitCriticalSection(g_graphicsContext); + g_application.getApplicationMessenger().Close(this, forceClose); + RestoreCriticalSection(g_graphicsContext, nCount); + } + else + g_application.getApplicationMessenger().Close(this, forceClose); +} + void CGUIDialog::DoModal(int iWindowID /*= WINDOW_INVALID */, const CStdString ¶m) { g_application.getApplicationMessenger().DoModal(this, iWindowID, param); |