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.
This commit is contained in:
Ignacio Etcheverry
2019-02-09 00:32:18 +01:00
parent 16d402147b
commit 9df44c2d2c
9 changed files with 88 additions and 19 deletions
@@ -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