Skip to content

Commit

Permalink
[fix] make sure the correct thread state is in place for the Py_EndIn…
Browse files Browse the repository at this point in the history
…terpreter.
  • Loading branch information
Jim Carroll committed Dec 25, 2012
1 parent 132730e commit 613af08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xbmc/interfaces/python/XBPyThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,9 @@ void XBPyThread::Process()
for (countLimit = 0; languageHook->HasRegisteredAddonClasses() && countLimit < 100; countLimit++)
{
PyThreadState* tmpstate = Py_NewInterpreter();
// if (PyRun_SimpleString(GC_SCRIPT) == -1)
// CLog::Log(LOGERROR,"Failed to run the gc to clean up after running %s",m_source);
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);
Py_EndInterpreter(tmpstate);
}

Expand Down

0 comments on commit 613af08

Please sign in to comment.