Permalink
Browse files

Merge pull request #1317 from jimfcarroll/fix-12578

Potential Deadlock fix
  • Loading branch information...
Jim Carroll
Jim Carroll committed Sep 4, 2012
2 parents a89fc47 + ddcfbb8 commit 0b630a8835eefba0f793d798af5442cb2ad72a6c
Showing with 7 additions and 4 deletions.
  1. +7 −4 xbmc/interfaces/python/XBPython.cpp
@@ -612,11 +612,14 @@ void XBPython::Finalize()
{
CLog::Log(LOGINFO, "Python, unloading python shared library because no scripts are running anymore");
- PyEval_AcquireLock();
- PyThreadState_Swap((PyThreadState*)m_mainThreadState);
+ {
+ CSingleExit exit(m_critSection);
+ PyEval_AcquireLock();
+ PyThreadState_Swap((PyThreadState*)m_mainThreadState);
- Py_Finalize();
- PyEval_ReleaseLock();
+ Py_Finalize();
+ PyEval_ReleaseLock();
+ }
#if !(defined(TARGET_DARWIN) || defined(_WIN32))
UnloadExtensionLibs();

0 comments on commit 0b630a8

Please sign in to comment.