blob: df3a2e12a6172797326117037c52caa5475008de [file] [log] [blame]
using System;
using System.Runtime.InteropServices;
namespace Apache
{
namespace Geode
{
namespace DotNetCore
{
public class GemfireClient : GemfireNativeObject
{
[DllImport(Constants.libPath, CharSet = CharSet.Auto)]
private static extern IntPtr apache_geode_ClientInitialize();
[DllImport(Constants.libPath, CharSet = CharSet.Auto)]
private static extern int apache_geode_ClientUninitialize(IntPtr client);
public GemfireClient()
{
_containedObject = apache_geode_ClientInitialize();
}
protected override void DestroyContainedObject()
{
var err = apache_geode_ClientUninitialize(_containedObject);
_containedObject = IntPtr.Zero;
if (err != 0) {
throw new InvalidOperationException("One or more native objects was leaked! See Gemfire log for debugging info.");
}
}
}
}
}
}