diff --git a/libs/lua/LuaBridge/detail/Namespace.h b/libs/lua/LuaBridge/detail/Namespace.h index 8af59cffe8..0190076d61 100644 --- a/libs/lua/LuaBridge/detail/Namespace.h +++ b/libs/lua/LuaBridge/detail/Namespace.h @@ -485,8 +485,8 @@ private: template static int ctorNilPtrPlacementProxy (lua_State* L) { - const T* newobject = new T (); - Stack::push (L, *newobject); + const T newobject; + Stack::push (L, newobject); return 1; }