mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Fixes a bug in the example code in object type. Ref<MyReference> myref = Ref<MyReference>(memnew(MyReference));
The statement is a compile error which emits use of overloaded operator '=' is ambiguous (with operand types 'Ref<FuncRef>' and 'FuncRef *') This commit uses neikeq suggestion of Ref<MyReference> myref(memnew(MyReference)); Fixes #506
This commit is contained in:
@@ -242,7 +242,7 @@ Declaring them must be done using Ref<> template. For example:
|
||||
GDCLASS(MyReference, Reference);
|
||||
};
|
||||
|
||||
Ref<MyReference> myref = memnew(MyReference);
|
||||
Ref<MyReference> myref(memnew(MyReference));
|
||||
|
||||
``myref`` is reference counted. It will be freed when no more Ref<>
|
||||
templates point to it.
|
||||
|
||||
Reference in New Issue
Block a user