Skip to content

Commit 92d512b

Browse files
Merge pull request #218 from Distributive-Network/philippe-176-211-201-fix
We need to add a reference to the PyObject we are proxying and keepin…
2 parents 387286b + cd1b2a6 commit 92d512b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[PythonMonkey](https://pythonmonkey.io) is a Mozilla [SpiderMonkey](https://firefox-source-docs.mozilla.org/js/index.html) JavaScript engine embedded into the Python Runtime,
77
using the Python engine to provide the Javascript host environment.
88

9-
We feature JavaScript Array and Object methods on Python List and Dictionaries using the cPython C API, and the inverse using the Mozilla Firefox Spidermonkey JavaScript C++ API.
9+
We feature JavaScript Array and Object methods implemented on Python List and Dictionaries using the cPython C API, and the inverse using the Mozilla Firefox Spidermonkey JavaScript C++ API.
1010

1111
This product is in an intermediate stage, approximately 90% to MVP as of January 2024. It is under active development by [Distributive](https://distributive.network/).
1212
External contributions and feedback are welcome and encouraged.

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)