Skip to content

Commit

Permalink
fix: provide strong references to DaedalusInstances
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Oct 12, 2024
1 parent ec06506 commit d3b701d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ZenKit/DaedalusInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ protected DaedalusInstance(UIntPtr handle)
Handle = handle;
}

~DaedalusInstance()
{
Native.ZkDaedalusInstance_release(Handle);
}

internal UIntPtr Handle { get; }

public DaedalusInstanceType Type => Native.ZkDaedalusInstance_getType(Handle);
Expand Down
3 changes: 3 additions & 0 deletions ZenKit/Native.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4019,6 +4019,9 @@ public static extern void ZkDaedalusScript_enumerateInstanceSymbols(UIntPtr slf,
[DllImport(DllName)]
public static extern uint ZkDaedalusSymbol_getIndex(UIntPtr slf);

[DllImport(DllName)]
public static extern void ZkDaedalusInstance_release(UIntPtr slf);

[DllImport(DllName)]
public static extern DaedalusDataType ZkDaedalusSymbol_getReturnType(UIntPtr slf);

Expand Down
Binary file modified ZenKit/runtimes/android-arm64/native/libzenkitcapi.so
Binary file not shown.
Binary file modified ZenKit/runtimes/linux-x64/native/libzenkitcapi.so
Binary file not shown.
Binary file modified ZenKit/runtimes/osx-x64/native/libzenkitcapi.dylib
Binary file not shown.
Binary file modified ZenKit/runtimes/win-x64/native/zenkitcapi.dll
Binary file not shown.

0 comments on commit d3b701d

Please sign in to comment.