Skip to content
This repository
Browse code

[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
authored December 23, 2012
10  xbmc/interfaces/python/XBPyThread.cpp
@@ -395,6 +395,7 @@ void XBPyThread::Process()
395 395
   }
396 396
 
397 397
   PyEval_AcquireLock();
  398
+  CLog::Log(LOGDEBUG,"**** acquired lock");
398 399
   PyThreadState_Swap(state);
399 400
 
400 401
   m_pExecuter->DeInitializeInterpreter();
@@ -424,10 +425,8 @@ void XBPyThread::Process()
424 425
     for (countLimit = 0; languageHook->HasRegisteredAddonClasses() && countLimit < 100; countLimit++)
425 426
     {
426 427
       PyThreadState* tmpstate = Py_NewInterpreter();
427  
-      PyThreadState* oldstate = PyThreadState_Swap(tmpstate);
428  
-      if (PyRun_SimpleString(GC_SCRIPT) == -1)
429  
-        CLog::Log(LOGERROR,"Failed to run the gc to clean up after running %s",m_source);
430  
-      PyThreadState_Swap(oldstate);
  428
+//      if (PyRun_SimpleString(GC_SCRIPT) == -1)
  429
+//        CLog::Log(LOGERROR,"Failed to run the gc to clean up after running %s",m_source);
431 430
       Py_EndInterpreter(tmpstate);
432 431
     }
433 432
 
@@ -447,8 +446,9 @@ void XBPyThread::Process()
447 446
   // unregister the language hook
448 447
   languageHook->UnregisterMe();
449 448
 
450  
-  PyThreadState_Swap(NULL);
451 449
   PyEval_ReleaseLock();
  450
+  CLog::Log(LOGDEBUG,"**** released lock");
  451
+
452 452
 }
453 453
 
454 454
 void XBPyThread::OnExit()
2  xbmc/interfaces/python/XBPython.h
@@ -26,8 +26,8 @@
26 26
 #include "threads/CriticalSection.h"
27 27
 #include "interfaces/IAnnouncer.h"
28 28
 #include "addons/IAddon.h"
29  
-#include "boost/shared_ptr.hpp"
30 29
 
  30
+#include <boost/shared_ptr.hpp>
31 31
 #include <vector>
32 32
 
33 33
 typedef struct {

0 notes on commit 4a46317

Please sign in to comment.
Something went wrong with that request. Please try again.