From 4ccdbde845437215dbb069b42231b4aebf06e327 Mon Sep 17 00:00:00 2001 From: sanikoyes Date: Thu, 18 Dec 2014 12:50:47 +0800 Subject: [PATCH] Fix crash when gd-script _init fail --- modules/gdscript/gd_script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 982584c75c8..97d97f1ef4e 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -1440,8 +1440,8 @@ GDInstance* GDScript::_create_instance(const Variant** p_args,int p_argcount,Obj if (err.error!=Variant::CallError::CALL_OK) { instance->script=Ref(); + instance->owner->set_script_instance(NULL); instances.erase(p_owner); - memdelete(instance); ERR_FAIL_COND_V(err.error!=Variant::CallError::CALL_OK, NULL); //error consrtucting }