50b603c7dc
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.
23 lines
498 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|