Skip to content

Commit d3b701d

Browse files
committed
fix: provide strong references to DaedalusInstances
1 parent ec06506 commit d3b701d

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

ZenKit/DaedalusInstance.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ protected DaedalusInstance(UIntPtr handle)
3838
Handle = handle;
3939
}
4040

41+
~DaedalusInstance()
42+
{
43+
Native.ZkDaedalusInstance_release(Handle);
44+
}
45+
4146
internal UIntPtr Handle { get; }
4247

4348
public DaedalusInstanceType Type => Native.ZkDaedalusInstance_getType(Handle);

ZenKit/Native.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4019,6 +4019,9 @@ public static extern void ZkDaedalusScript_enumerateInstanceSymbols(UIntPtr slf,
40194019
[DllImport(DllName)]
40204020
public static extern uint ZkDaedalusSymbol_getIndex(UIntPtr slf);
40214021

4022+
[DllImport(DllName)]
4023+
public static extern void ZkDaedalusInstance_release(UIntPtr slf);
4024+
40224025
[DllImport(DllName)]
40234026
public static extern DaedalusDataType ZkDaedalusSymbol_getReturnType(UIntPtr slf);
40244027

4.12 KB
Binary file not shown.
48 Bytes
Binary file not shown.
112 Bytes
Binary file not shown.
-1007 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)