16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 06:39:18 +02:00

macos tweaks

This commit is contained in:
milek7
2021-01-19 19:03:42 +01:00
parent 5fcd108b3d
commit 809f0c2077
3 changed files with 25 additions and 9 deletions

View File

@@ -163,10 +163,9 @@ auto python_taskqueue::init() -> bool {
else
Py_SetPythonHome("macpython");
#endif
Py_Initialize();
PyEval_InitThreads();
Py_InitializeEx(0);
m_initialized = true;
PyEval_InitThreads();
PyObject *stringiomodule { nullptr };
PyObject *stringioclassname { nullptr };
@@ -213,6 +212,8 @@ auto python_taskqueue::init() -> bool {
if( false == worker.joinable() ) { return false; }
}
m_initialized = true;
return true;
release_and_exit:
@@ -246,7 +247,8 @@ void python_taskqueue::exit() {
// adds specified task along with provided collection of data to the work queue. returns true on success
auto python_taskqueue::insert( task_request const &Task ) -> bool {
if( ( false == Global.python_enabled )
if( !m_initialized
|| ( false == Global.python_enabled )
|| ( Task.renderer.empty() )
|| ( Task.input == nullptr )
|| ( Task.target == 0 ) ) { return false; }