diff options
| author | Juan Linietsky | 2014-04-05 12:39:30 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-04-05 12:39:30 -0300 |
| commit | 9f33134c93ecbadda70e8eefc50563e29b2eb7f2 (patch) | |
| tree | 299ded94fe74a61bf8094935d0f3283f6f30e435 /modules/gdscript/gd_script.cpp | |
| parent | 35b84d2c85fd152bee05d7d5a05e20a5f602a285 (diff) | |
| download | godot-9f33134c93ecbadda70e8eefc50563e29b2eb7f2.tar.gz godot-9f33134c93ecbadda70e8eefc50563e29b2eb7f2.tar.zst godot-9f33134c93ecbadda70e8eefc50563e29b2eb7f2.zip | |
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
| -rw-r--r-- | modules/gdscript/gd_script.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 29857e6be..75bb47cea 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -635,6 +635,19 @@ Variant GDFunction::call(GDInstance *p_instance,const Variant **p_args, int p_ar err.argument-=1; } } + } if (methodstr=="free") { + + if (err.error==Variant::CallError::CALL_ERROR_INVALID_METHOD) { + + if (base->is_ref()) { + err_text="Attempted to free a reference."; + break; + } else if (base->get_type()==Variant::OBJECT) { + + err_text="Attempted to free a locked object (calling or emitting)."; + break; + } + } } err_text=_get_call_error(err,"function '"+methodstr+"' in base '"+basestr+"'",(const Variant**)argptrs); break; |
