onnxruntime/csharp/src/Microsoft.ML.OnnxRuntime/NativeOnnxObjectHandle.cs
Ryan Hill 11b369a864
Abbreviate ONNXRuntime as Ort in all of our public APIs (#175)
Applies to all public headers and macros, plus many internal ones. There are still some internal things with OnnxRuntime in the name, but this fixes all public functions & macros.
2018-12-14 14:54:23 -08:00

28 lines
594 B
C#

using System;
using System.Runtime.InteropServices;
namespace Microsoft.ML.OnnxRuntime
{
internal class NativeOnnxObjectHandle : SafeHandle
{
public NativeOnnxObjectHandle(IntPtr ptr)
: base(IntPtr.Zero, true)
{
handle = ptr;
}
public override bool IsInvalid
{
get
{
return (handle == IntPtr.Zero);
}
}
protected override bool ReleaseHandle()
{
NativeMethods.OrtReleaseObject(handle);
return true;
}
}
}