Skip to content

Commit 6317604

Browse files
Update src/PyListProxyHandler.cc
Co-authored-by: Caleb Aikens <[email protected]>
1 parent a5dfe1b commit 6317604

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PyListProxyHandler.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ static bool array_indexOf(JSContext *cx, unsigned argc, JS::Value *vp) {
279279
}
280280

281281
JS::RootedValue elementVal(cx, args[0].get());
282-
PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, elementVal), start);
282+
PyObject *value = pyTypeFactory(cx, elementVal);
283+
PyObject *result = PyObject_CallMethod(self, "index", "Oi", value, start);
284+
Py_DECREF(value);
283285

284286
if (!result) {
285287
PyErr_Clear();

0 commit comments

Comments
 (0)