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

Merge branch 'tmj-dev' into milek-dev

This commit is contained in:
milek7
2019-02-21 18:18:32 +01:00
29 changed files with 1460 additions and 1069 deletions

View File

@@ -23,7 +23,10 @@ void render_task::run() {
// convert provided input to a python dictionary
auto *input = PyDict_New();
if( input == nullptr ) { goto exit; }
if( input == nullptr ) {
cancel();
return;
}
for( auto const &datapair : m_input->floats ) { PyDict_SetItemString( input, datapair.first.c_str(), PyGetFloat( datapair.second ) ); }
for( auto const &datapair : m_input->integers ) { PyDict_SetItemString( input, datapair.first.c_str(), PyGetInt( datapair.second ) ); }
for( auto const &datapair : m_input->bools ) { PyDict_SetItemString( input, datapair.first.c_str(), PyGetBool( datapair.second ) ); }
@@ -62,10 +65,8 @@ void render_task::run() {
Py_DECREF( output );
}
exit:
// clean up after yourself
delete m_input;
delete this;
cancel();
}
void render_task::cancel() {