MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / finalize

Method finalize

src/PyObjectProxyHandler.cc:88–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void PyObjectProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {
89 // We cannot call Py_DECREF here when shutting down as the thread state is gone.
90 // Then, when shutting down, there is only on reference left, and we don't need
91 // to free the object since the entire process memory is being released.
92 if (!Py_IsFinalizing()) {
93 PyObject *self = JS::GetMaybePtrFromReservedSlot<PyObject>(proxy, PyObjectSlot);
94 Py_DECREF(self);
95 }
96}
97
98bool PyObjectProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const {
99 PyObject *self = JS::GetMaybePtrFromReservedSlot<PyObject>(proxy, PyObjectSlot);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected