Skip to content

Commit cc97b8a

Browse files
committed
Add an Action variant of TryUsingDll
1 parent e9283e3 commit cc97b8a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/runtime/Runtime.cs

+3
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,9 @@ internal static unsafe nint Refcount(BorrowedReference op)
672672
[Pure]
673673
internal static int Refcount32(BorrowedReference op) => checked((int)Refcount(op));
674674

675+
internal static void TryUsingDll(Action op) =>
676+
TryUsingDll(() => { op(); return 0; });
677+
675678
/// <summary>
676679
/// Call specified function, and handle PythonDLL-related failures.
677680
/// </summary>

0 commit comments

Comments
 (0)