Skip to content

Commit 9f51dc5

Browse files
we need to add a reference to the PyObject we are proxying and keeping in a reserved slot
1 parent 387286b commit 9f51dc5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/jsTypeFactory.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) {
180180
JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will
181181
proxy = js::NewProxyObject(cx, new PyDictProxyHandler(object), v, objectPrototype.get());
182182
}
183+
Py_INCREF(object); // TODO leak! clean up in finalize
183184
JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object));
184185
returnType.setObject(*proxy);
185186
}

0 commit comments

Comments
 (0)