diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-02-03 06:35:22 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-02-03 06:47:25 +0100 |
commit | 3233083f63dc668b8dd21290d25a511212f114d8 (patch) | |
tree | 5aa7f8a9da59fa80495747daa853ebd666203693 /core/object.cpp | |
parent | 4e4e889c751ac57a217ea924ea0a03e43bd3e6d6 (diff) | |
download | redot-engine-3233083f63dc668b8dd21290d25a511212f114d8.tar.gz |
Mono: Lifetime fixes for CSharpInstance and instance binding data
Avoid CSharpInstance from accessing its state after self destructing (by deleting the Reference owner).
It's now safe to replace the script instance without leaking or crashing.
Also fixed godot_icall_Object_weakref return reference being freed before returning.
Diffstat (limited to 'core/object.cpp')
-rw-r--r-- | core/object.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/object.cpp b/core/object.cpp index 682586a7ab..05e661baab 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1924,6 +1924,11 @@ void *Object::get_script_instance_binding(int p_script_language_index) { return _script_instance_bindings[p_script_language_index]; } +bool Object::has_script_instance_binding(int p_script_language_index) { + + return _script_instance_bindings[p_script_language_index] != NULL; +} + Object::Object() { _class_ptr = NULL; |