diff --git a/src/objstore.cc b/src/objstore.cc index 7ef5d72..434e079 100644 --- a/src/objstore.cc +++ b/src/objstore.cc @@ -120,6 +120,8 @@ Value PyObjectWrap::NewCallable(Napi::Env env, PyStrongRef &&py) { VERBOSE_PYOBJ(CALL, *py, "Funcstore retrieve"); assert(!it->second->Value().IsEmpty()); js = it->second->Value(); + // The caller expects this to be destroyed + py = nullptr; } return js;