GtkSharp/gtk/Object.custom

29 lines
580 B
Text
Raw Normal View History

// Gtk.Object.custom - Gtk Window class customizations
//
// Author: Mike Kestner <mkestner@speakeasy.net>
//
// (c) 2002 Mike Kestner
//
// This code is inserted after the automatically generated code.
[DllImport("gtksharpglue")]
static extern void gtksharp_object_unref_if_floating (IntPtr raw);
protected override void DisposeNative ()
{
if (_needs_unref)
base.DisposeNative ();
else
gtksharp_object_unref_if_floating (Handle);
}
private bool _needs_unref = false;
public override void Ref ()
{
_needs_unref = true;
base.Ref ();
}