Skip to content

Commit

Permalink
fix the reference count for dicts test_get_default_not_found
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Xmader committed Oct 8, 2024
1 parent bb78bbd commit 1a98043
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/JSObjectProxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get_method(JSObjectProxy

PyObject *value = JSObjectProxy_get(self, key);
if (value == Py_None) {
Py_INCREF(default_value);
value = default_value;
}

Expand Down

0 comments on commit 1a98043

Please sign in to comment.