Hmmm something is wrong here with the Python interpreter

Former-commit-id: bfa87ac83ae1518348e5fe1ed77f20475134e1b0
This commit is contained in:
Johan
2013-11-28 16:26:32 +01:00
parent c18920b59e
commit 45e4aff5f1
3 changed files with 9 additions and 10 deletions

View File

@@ -5,6 +5,8 @@
#include <effectengine/EffectEngine.h>
#include "Effect.h"
//static PyThreadState *_mainThreadState = 0;
EffectEngine::EffectEngine(Hyperion * hyperion) :
_hyperion(hyperion),
_availableEffects(),
@@ -21,6 +23,7 @@ EffectEngine::EffectEngine(Hyperion * hyperion) :
std::cout << "Initializing Python interpreter" << std::endl;
Py_InitializeEx(0);
PyEval_InitThreads(); // Create the GIL
//_mainThreadState = PyEval_SaveThread();
PyEval_ReleaseLock(); // Release the GIL
}
@@ -29,7 +32,8 @@ EffectEngine::~EffectEngine()
// clean up the Python interpreter
std::cout << "Cleaning up Python interpreter" << std::endl;
PyEval_AcquireLock(); // Get the Gil
Py_Finalize();
//PyEval_RestoreThread(_mainThreadState);
//Py_Finalize();
}
std::list<std::string> EffectEngine::getEffects() const