From 6c7fccda293cc8aa07bb5741ee672a1b1d63ba91 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 22 Sep 2004 17:48:21 +0000 Subject: [PATCH] use ref instead of unsafe pointer stuff --- bindings/dotnet/default.build | 1 - bindings/dotnet/src/Sigar.cs | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) 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); }