diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-30 07:54:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-30 07:54:42 +0100 |
commit | 99324d9fdac44a528d54027b8997b4cf44e5934e (patch) | |
tree | 6ec88995979a473f18fb95eb888300ba4aa8e180 | |
parent | d749b738ad3f49107ec061dfa3679b14238ff681 (diff) | |
parent | bcbe5b58507fb9534507b570653e32357182ab52 (diff) |
Merge pull request #33168 from nekomatata/weak-ref-leak
Fixed leak in gdscript when creating empty WeakRef
-rw-r--r-- | modules/gdscript/gdscript_functions.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index d9535d0f1f..c4c7ba5ef7 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -589,7 +589,8 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ r_ret = wref; } } else if (p_args[0]->get_type() == Variant::NIL) { - r_ret = memnew(WeakRef); + Ref<WeakRef> wref = memnew(WeakRef); + r_ret = wref; } else { r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; |