Files
libgphoto2/bindings/csharp/Object.cs
2005-08-31 21:24:59 +00:00

34 lines
501 B
C#

using System;
using System.Runtime.InteropServices;
namespace LibGPhoto2 {
public abstract class Object : System.IDisposable {
protected HandleRef handle;
public HandleRef Handle {
get {
return handle;
}
}
public Object () {}
public Object (IntPtr ptr)
{
handle = new HandleRef (this, ptr);
}
protected abstract void Cleanup ();
public void Dispose () {
Cleanup ();
System.GC.SuppressFinalize (this);
}
~Object ()
{
Cleanup ();
}
}
}