Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix] allow the EndInterpreter to Swap NULL in for the thread (like t…

…he Docs say it does).
  • Loading branch information...
commit 4a463178a5de1b31a13013d2cf6cc257d1ba7270 1 parent 2902650
Jim Carroll authored
View
10 xbmc/interfaces/python/XBPyThread.cpp
@@ -395,6 +395,7 @@ void XBPyThread::Process()
}
PyEval_AcquireLock();
+ CLog::Log(LOGDEBUG,"**** acquired lock");
PyThreadState_Swap(state);
m_pExecuter->DeInitializeInterpreter();
@@ -424,10 +425,8 @@ void XBPyThread::Process()
for (countLimit = 0; languageHook->HasRegisteredAddonClasses() && countLimit < 100; countLimit++)
{
PyThreadState* tmpstate = Py_NewInterpreter();
- PyThreadState* oldstate = PyThreadState_Swap(tmpstate);
- if (PyRun_SimpleString(GC_SCRIPT) == -1)
- CLog::Log(LOGERROR,"Failed to run the gc to clean up after running %s",m_source);
- PyThreadState_Swap(oldstate);
+// if (PyRun_SimpleString(GC_SCRIPT) == -1)
+// CLog::Log(LOGERROR,"Failed to run the gc to clean up after running %s",m_source);
Py_EndInterpreter(tmpstate);
}
@@ -447,8 +446,9 @@ void XBPyThread::Process()
// unregister the language hook
languageHook->UnregisterMe();
- PyThreadState_Swap(NULL);
PyEval_ReleaseLock();
+ CLog::Log(LOGDEBUG,"**** released lock");
+
}
void XBPyThread::OnExit()
View
2  xbmc/interfaces/python/XBPython.h
@@ -26,8 +26,8 @@
#include "threads/CriticalSection.h"
#include "interfaces/IAnnouncer.h"
#include "addons/IAddon.h"
-#include "boost/shared_ptr.hpp"
+#include <boost/shared_ptr.hpp>
#include <vector>
typedef struct {
Please sign in to comment.
Something went wrong with that request. Please try again.