summaryrefslogtreecommitdiff
path: root/modules/gdnative/pluginscript/pluginscript_instance.cpp
diff options
context:
space:
mode:
authorEmmanuel Leblond <emmanuel.leblond@gmail.com>2018-01-15 23:20:02 +0100
committerEmmanuel Leblond <emmanuel.leblond@gmail.com>2018-01-16 00:23:27 +0100
commit0de61998e42b368efe90ad07838aea99752447c0 (patch)
treefdc42c6d60d7e651c0433abb82ff77ee4d60c090 /modules/gdnative/pluginscript/pluginscript_instance.cpp
parent05b1843818fd07f084816ec506ec505e24f8f02c (diff)
Improve inheritance system in gdnative pluginscript
Diffstat (limited to 'modules/gdnative/pluginscript/pluginscript_instance.cpp')
-rw-r--r--modules/gdnative/pluginscript/pluginscript_instance.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gdnative/pluginscript/pluginscript_instance.cpp b/modules/gdnative/pluginscript/pluginscript_instance.cpp
index 52d112bc93..931ab0bfe4 100644
--- a/modules/gdnative/pluginscript/pluginscript_instance.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_instance.cpp
@@ -84,8 +84,9 @@ Variant PluginScriptInstance::call(const StringName &p_method, const Variant **p
godot_variant ret = _desc->call_method(
_data, (godot_string_name *)&p_method, (const godot_variant **)p_args,
p_argcount, (godot_variant_call_error *)&r_error);
- Variant *var_ret = (Variant *)&ret;
- return *var_ret;
+ Variant var_ret = *(Variant *)&ret;
+ godot_variant_destroy(&ret);
+ return var_ret;
}
#if 0 // TODO: Don't rely on default implementations provided by ScriptInstance ?