You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
C#: Ensure native handles are freed after switch to .NET Core
Finalizers are longer guaranteed to be called on exit now that we switched to .NET Core. This results in native instances leaking. The only solution I can think of so far is to keep a list of all instances alive to dispose when the AssemblyLoadContext.Unloading event is raised.
This commit is contained in:
@@ -68,6 +68,7 @@ void update_godot_api_cache(const ManagedCallbacks &p_managed_callbacks) {
|
||||
CHECK_CALLBACK_NOT_NULL(GCHandleBridge, FreeGCHandle);
|
||||
CHECK_CALLBACK_NOT_NULL(DebuggingUtils, InstallTraceListener);
|
||||
CHECK_CALLBACK_NOT_NULL(Dispatcher, InitializeDefaultGodotTaskScheduler);
|
||||
CHECK_CALLBACK_NOT_NULL(DisposablesTracker, OnGodotShuttingDown);
|
||||
|
||||
managed_callbacks = p_managed_callbacks;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user