diff options
| author | sanikoyes | 2014-12-18 12:50:47 +0800 |
|---|---|---|
| committer | sanikoyes | 2014-12-18 12:50:47 +0800 |
| commit | 4ccdbde845437215dbb069b42231b4aebf06e327 (patch) | |
| tree | 64688092a0f8a68d0f2b6255cc68bffe22c034e1 /modules/gdscript/gd_script.cpp | |
| parent | bed3b7f092881223f7b58c26e65d03b052e5313f (diff) | |
| download | godot-4ccdbde845437215dbb069b42231b4aebf06e327.tar.gz godot-4ccdbde845437215dbb069b42231b4aebf06e327.tar.zst godot-4ccdbde845437215dbb069b42231b4aebf06e327.zip | |
Fix crash when gd-script _init fail
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
| -rw-r--r-- | modules/gdscript/gd_script.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 982584c75..97d97f1ef 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<GDScript>(); + 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 } |
