* gtk/Object.custom (Raw): Always ref the object, even if it's not

floating when we get it, since GLib assumes we hold a ref on it.
        [Fixes #74468]

        * gtk/Window.custom: remove refcount special-handling here

svn path=/trunk/gtk-sharp/; revision=42653
This commit is contained in:
Dan Winship 2005-04-07 20:05:52 +00:00
parent ec96098612
commit 7c80282cfd
3 changed files with 10 additions and 31 deletions

View file

@ -1,3 +1,11 @@
2005-04-07 Dan Winship <danw@novell.com>
* gtk/Object.custom (Raw): Always ref the object, even if it's not
floating when we get it, since GLib assumes we hold a ref on it.
[Fixes #74468]
* gtk/Window.custom: remove refcount special-handling here
2005-04-06 Mike Kestner <mkestner@novell.com> 2005-04-06 Mike Kestner <mkestner@novell.com>
* gtk/FileFilter.custom : AddCustom delegate is destroy notified. * gtk/FileFilter.custom : AddCustom delegate is destroy notified.

View file

@ -39,12 +39,9 @@
if (value == IntPtr.Zero) if (value == IntPtr.Zero)
return; return;
if (gtksharp_object_is_floating (value)) {
g_object_ref (value); g_object_ref (value);
Sink (); Sink ();
} }
// System.Diagnostics.Debug.WriteLine ("Gtk.Object:set_Raw: object type is: " + (this as GLib.Object).GType.Name + " refcount now: " + RefCount + " needs_ref: " + needs_ref);
}
} }
[DllImport("libgtk-win32-2.0-0.dll")] [DllImport("libgtk-win32-2.0-0.dll")]

View file

@ -21,32 +21,6 @@
// Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA. // Boston, MA 02111-1307, USA.
[DllImport("libgobject-2.0-0.dll")]
private static extern void g_object_ref (IntPtr raw);
static Hashtable windows = new Hashtable ();
protected override IntPtr Raw {
get {
return base.Raw;
}
set {
base.Raw = value;
if (value == IntPtr.Zero)
return;
g_object_ref (value);
windows [value] = this;
}
}
public override void Destroy ()
{
base.Destroy ();
windows [Handle] = null;
}
public Window (String title) : this (WindowType.Toplevel) public Window (String title) : this (WindowType.Toplevel)
{ {
this.Title = title; this.Title = title;