mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +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:
parent
4d710bf659
commit
f88d8902cf
15 changed files with 185 additions and 32 deletions
|
@ -1581,6 +1581,7 @@ void CSharpLanguage::tie_managed_to_unmanaged_with_pre_setup(GCHandleIntPtr p_gc
|
|||
CSharpInstance *instance = CAST_CSHARP_INSTANCE(p_unmanaged->get_script_instance());
|
||||
|
||||
if (!instance) {
|
||||
// Native bindings don't need post-setup
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue