From a6a5ef0fd690123d8f646bca47f7ae6e2ad3bbfe Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Mon, 13 Jan 2020 21:00:07 +0100 Subject: Mono/C#: Add error checks to detect possible Reference leaks --- modules/mono/csharp_script.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/mono/csharp_script.h') diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 027f429125..30f56e00bd 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -307,6 +307,11 @@ class CSharpLanguage : public ScriptLanguage { Map script_bindings; +#ifdef DEBUG_ENABLED + // List of unsafely referenced objects + List unsafely_referenced_objects; +#endif + struct StringNameCache { StringName _signal_callback; @@ -458,6 +463,9 @@ public: Vector stack_trace_get_info(MonoObject *p_stack_trace); #endif + void post_unsafe_reference(Object *p_obj); + void pre_unsafe_unreference(Object *p_obj); + CSharpLanguage(); ~CSharpLanguage(); }; -- cgit v1.2.3