From f6f2be7577f0f952c446064252339b7142109ea7 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Sat, 1 Dec 2018 02:23:55 +0100 Subject: Fix crash due to ~CSharpInstance() being called on freed instance This would be the case when calling SetScript on an object with a C# script. --- modules/mono/csharp_script.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/mono/csharp_script.h') diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 269d7ebe42..501e0d9d6d 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -198,6 +198,7 @@ class CSharpInstance : public ScriptInstance { bool ref_dying; bool unsafe_referenced; bool predelete_notified; + bool destructing_script_instance; Ref script; Ref gchandle; @@ -218,6 +219,8 @@ class CSharpInstance : public ScriptInstance { public: MonoObject *get_mono_object() const; + _FORCE_INLINE_ bool is_destructing_script_instance() { return destructing_script_instance; } + virtual bool set(const StringName &p_name, const Variant &p_value); virtual bool get(const StringName &p_name, Variant &r_ret) const; virtual void get_property_list(List *p_properties) const; -- cgit v1.2.3