fix frequently segfault on clean shutdown
[enigma2.git] / lib / python / python.cpp
index 8947bb3ca12826f63e0a4d811809c560ca705c63..8e9fbd7e18b1b1bbd46f9ecbb3f38c48394b1664 100644 (file)
@@ -114,18 +114,6 @@ void ePyObject::decref(const char *file, int line)
 #include <lib/python/python.h>
 #undef SKIP_PART1
 
-DEFINE_REF(TestObj);
-
-TestObj::TestObj()
-{
-       eDebug("create %p", this);
-}
-
-TestObj::~TestObj()
-{
-       eDebug("destroy %p", this);
-}
-
 ePython::ePython()
 {
 //     Py_VerboseFlag = 1;
@@ -133,7 +121,8 @@ ePython::ePython()
 //     Py_OptimizeFlag = 1;
        
        Py_Initialize();
-       
+       PyEval_InitThreads();
+
        init_enigma();
 }
 
@@ -199,6 +188,7 @@ int ePython::call(ePyObject pFunc, ePyObject pArgs)
                } else
                {
                        PyErr_Print();
+                       eDebug("(PyObject_CallObject failed)");
                        bsodFatal();
                }
        }