From 9df44c2d2cbae10aa7b27b2562d00d69c2caecb8 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Mon, 4 Feb 2019 20:39:02 +0100 Subject: Use script instance binding for objects constructed from C# Only possible if the object class is a "native type". If the object class is a user class (that derives a "native type") then a script is needed. Since CSharpLanguage does cleanup of script instance bindings when finished, cases like #25621 will no longer cause problems. Fixed ~Object() trying to free script instance bindings after the language has already been removed, which would result in a NULL dereference. --- modules/mono/editor/bindings_generator.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/mono/editor/bindings_generator.cpp') diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 0b6a6a327c..77e9b1f1f4 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -849,6 +849,8 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str } } + // TODO: BINDINGS_NATIVE_NAME_FIELD should be StringName, once we support it in C# + if (itype.is_singleton) { // Add the type name and the singleton pointer as static fields -- cgit v1.2.3