Skip to content

Commit 1a98043

Browse files
committed
fix the reference count for dicts test_get_default_not_found
Something is double-free-ed during the final finalization: in a debug build of Python, `./Include/object.h:602: _Py_NegativeRefcount: Assertion failed: object has negative ref count` In non-debug build of Python, it simply segfaults at the end during finalization.
1 parent bb78bbd commit 1a98043

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/JSObjectProxy.cc

+1
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get_method(JSObjectProxy
637637

638638
PyObject *value = JSObjectProxy_get(self, key);
639639
if (value == Py_None) {
640+
Py_INCREF(default_value);
640641
value = default_value;
641642
}
642643

0 commit comments

Comments
 (0)