Permalink
Browse files

Fix for deadlock - fixes 12578

  • Loading branch information...
1 parent c317d94 commit ddcfbb8ef179254aa5701207190aa2edb2c36c53 Jim Carroll committed Mar 19, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 xbmc/interfaces/python/XBPython.cpp
@@ -414,11 +414,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(__APPLE__) || defined(_WIN32))
UnloadExtensionLibs();

0 comments on commit ddcfbb8

Please sign in to comment.