mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
![Rachel Hestilow](/assets/img/avatar_default.png)
* glib/Object.cs (Ref): Added. * gtk/Object.custom (Ref): Overload. Note that we were reffed. (DisposeNative): Unref if we were explicitly reffed. * generator/Method.cs: Call Ref if needs_ret is set. * generator/StructBase.cs: Call Ref on all object accessors. * glue/style.c: Ref returned GCs. * sources/Gtk.metadata: Set needs_ret on various gdk-related accessors in GtkWidget. Hide Ref/Unref methods on Widget and RcStyle as these ought to be deprecated anyway. svn path=/trunk/gtk-sharp/; revision=7380
29 lines
580 B
Plaintext
Executable File
29 lines
580 B
Plaintext
Executable File
// 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 ();
|
|
}
|
|
|