+ fix crash due to sloppy reference counting

This commit is contained in:
wmayer
2015-09-15 18:19:36 +02:00
parent d9aa9e4bf1
commit 200362779f
4 changed files with 20 additions and 1 deletions

View File

@@ -167,6 +167,7 @@ PyObject* CommandPy::setFromGCode(PyObject *args)
if (PyArg_ParseTuple(args, "s", &pstr)) {
std::string gcode(pstr);
getCommandPtr()->setFromGCode(gcode);
Py_INCREF(Py_None);
return Py_None;
}
throw Py::Exception("Argument must be a string");
@@ -211,6 +212,7 @@ PyObject *CommandPy::getCustomAttributes(const char* attr) const
if (getCommandPtr()->Parameters.count(satt)) {
return PyFloat_FromDouble(getCommandPtr()->Parameters[satt]);
}
Py_INCREF(Py_None);
return Py_None;
}
}