diff --git a/development/cpp/object_class.rst b/development/cpp/object_class.rst index 108cf57b..9a1420c5 100644 --- a/development/cpp/object_class.rst +++ b/development/cpp/object_class.rst @@ -242,7 +242,7 @@ Declaring them must be done using Ref<> template. For example: GDCLASS(MyReference, Reference); }; - Ref myref = memnew(MyReference); + Ref myref(memnew(MyReference)); ``myref`` is reference counted. It will be freed when no more Ref<> templates point to it.