diff --git a/moo/moocpp/gobjectptr.h b/moo/moocpp/gobjectptr.h index 0cfd93f6..e7b602ad 100644 --- a/moo/moocpp/gobjectptr.h +++ b/moo/moocpp/gobjectptr.h @@ -51,7 +51,7 @@ public: auto* tmp = m_obj; m_obj = nullptr; if (tmp) - ObjRefUnrefHelper::unref(m_obj); + ObjRefUnrefHelper::unref(tmp); } ObjClass* get() const { return m_obj; }