Commit e0e1b12d authored by Michael Droettboom's avatar Michael Droettboom

Fix reference counting

parent 280de281
......@@ -27,7 +27,7 @@ PyObject *jsToPython(val x) {
Py_INCREF(Py_False);
return Py_False;
} else if (!x["$$"].isUndefined() &&
x["$$"]["ptrType"]["name"].equals(val("Py*"))) {
x["$$"]["ptrType"]["name"].equals(val("Py*"))) {
Py py_x = x.as<Py>();
PyObject *pypy_x = py_x.x;
Py_INCREF(pypy_x);
......@@ -70,6 +70,7 @@ PyObject *jsToPythonKwargs(val kwargs) {
PyObject *k = jsToPython(keys[i]);
PyObject *v = jsToPython(kwargs[keys[i]]);
if (PyDict_SetItem(pykwargs, k, v)) {
Py_DECREF(pykwargs);
return NULL;
}
Py_DECREF(k);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment