Merge pull request #88 from Zylann/fix_ref_return_leak
Fix Ref leak when using Godot getters
This commit is contained in:
@@ -199,6 +199,15 @@ public:
|
||||
|
||||
unref();
|
||||
}
|
||||
|
||||
// Used exclusively in the bindings to recreate the Ref Godot encapsulates in return values,
|
||||
// without adding to the refcount.
|
||||
inline static Ref<T> __internal_constructor(Object *obj)
|
||||
{
|
||||
Ref<T> r;
|
||||
r.reference = (T*)obj;
|
||||
return r;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user