git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8232 67ed7778-7388-44ab-90cf-0a291f65f57c
34 lines
501 B
C#
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 ();
|
|
}
|
|
}
|
|
}
|