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:
@ -54,6 +54,7 @@ class ScriptServer {
|
||||
static int _language_count;
|
||||
static bool scripting_enabled;
|
||||
static bool reload_scripts_on_save;
|
||||
static bool languages_finished;
|
||||
|
||||
struct GlobalScriptClass {
|
||||
StringName language;
|
||||
@ -91,6 +92,8 @@ public:
|
||||
|
||||
static void init_languages();
|
||||
static void finish_languages();
|
||||
|
||||
static bool are_languages_finished() { return languages_finished; }
|
||||
};
|
||||
|
||||
class ScriptInstance;
|
||||
|
||||
Reference in New Issue
Block a user