diff --git a/bindings/dotnet/default.build b/bindings/dotnet/default.build index f847355b..d8244870 100644 --- a/bindings/dotnet/default.build +++ b/bindings/dotnet/default.build @@ -25,7 +25,6 @@ diff --git a/bindings/dotnet/src/Sigar.cs b/bindings/dotnet/src/Sigar.cs index c2aad542..8f852e21 100644 --- a/bindings/dotnet/src/Sigar.cs +++ b/bindings/dotnet/src/Sigar.cs @@ -34,16 +34,14 @@ namespace Hyperic.Sigar { internal HandleRef sigar; [DllImport(LIBSIGAR)] - unsafe private static extern int sigar_open(IntPtr *sigar); + private static extern int sigar_open(ref IntPtr sigar); [DllImport(LIBSIGAR)] private static extern int sigar_close(IntPtr sigar); public Sigar() { - IntPtr handle; - unsafe { //&pointers are considered "unsafe" - sigar_open(&handle); - } + IntPtr handle = IntPtr.Zero; + sigar_open(ref handle); this.sigar = new HandleRef(this, handle); }