godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/GCHandleBridge.cs
Ignacio Roldán Etcheverry 50b603c7dc C#: Begin move to .NET Core
We're targeting .NET 5 for now to make development easier while
.NET 6 is not yet released.

TEMPORARY REGRESSIONS
---------------------

Assembly unloading is not implemented yet. As such, many Godot
resources are leaked at exit. This will be re-implemented later
together with assembly hot-reloading.
2021-09-22 08:27:12 +02:00

23 lines
498 B
C#

using System;
using System.Runtime.InteropServices;
using Godot.NativeInterop;
namespace Godot.Bridge
{
internal static class GCHandleBridge
{
[UnmanagedCallersOnly]
internal static void FreeGCHandle(IntPtr gcHandlePtr)
{
try
{
GCHandle.FromIntPtr(gcHandlePtr).Free();
}
catch (Exception e)
{
ExceptionUtils.DebugPrintUnhandledException(e);
}
}
}
}