Commit 22be7eec authored by Michael Droettboom's avatar Michael Droettboom Committed by GitHub

Merge pull request #310 from jstafford/reference-count-bugfix

add missing hiwire_decref, fixes issue #301
parents fc7d9404 1c780435
......@@ -200,13 +200,15 @@ JsProxy_IterNext(PyObject* o)
int iddone = hiwire_get_member_string(idresult, (int)"done");
int done = hiwire_nonzero(iddone);
hiwire_decref(iddone);
if (done) {
return NULL;
PyObject* pyvalue = NULL;
if (!done) {
int idvalue = hiwire_get_member_string(idresult, (int)"value");
pyvalue = js2python(idvalue);
hiwire_decref(idvalue);
}
int idvalue = hiwire_get_member_string(idresult, (int)"value");
PyObject* pyvalue = js2python(idvalue);
hiwire_decref(idvalue);
hiwire_decref(idresult);
return pyvalue;
}
......
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