Fix crash on exit when C# code was bound to asset unloading event called after C# shutdown

This commit is contained in:
Wojtek Figat
2025-11-18 18:00:02 +01:00
parent 3efb981f00
commit c0dda45c7b
4 changed files with 14 additions and 1 deletions

View File

@@ -21,6 +21,7 @@
MDomain* MRootDomain = nullptr;
MDomain* MActiveDomain = nullptr;
Array<MDomain*, FixedAllocation<4>> MDomains;
bool MCore::Ready = false;
MClass* MCore::TypeCache::Void = nullptr;
MClass* MCore::TypeCache::Object = nullptr;
@@ -301,6 +302,11 @@ bool MProperty::IsStatic() const
return false;
}
void MCore::OnManagedEventAfterShutdown(const char* eventName)
{
LOG(Error, "Found a binding leak on '{}' event used by C# scripting after shutdown. Ensure to unregister scripting events from objects during disposing.", ::String(eventName));
}
MDomain* MCore::GetRootDomain()
{
return MRootDomain;