From 67e0164e7d2708fb1152a29323677bb2bea46c49 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Fri, 17 Oct 2003 22:31:46 +0000 Subject: [PATCH] 2003-10-17 Mike Kestner * gtk/Window.cs : override Raw prop and take a ref, since gtk+ owns the ref to new Windows, and we need a ref. [Fixes #47721] svn path=/trunk/gtk-sharp/; revision=19151 --- ChangeLog | 5 +++++ gtk/Object.custom | 4 ++-- gtk/Window.custom | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 247b71645..c9bccf162 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-10-17 Mike Kestner + + * gtk/Window.cs : override Raw prop and take a ref, since gtk+ + owns the ref to new Windows, and we need a ref. [Fixes #47721] + 2003-10-17 Mike Kestner * gnome/CanvasPoints.custom : make New overload a ctor overload. diff --git a/gtk/Object.custom b/gtk/Object.custom index 153fa6d1d..f6783fe02 100755 --- a/gtk/Object.custom +++ b/gtk/Object.custom @@ -1,8 +1,8 @@ -// Gtk.Object.custom - Gtk Window class customizations +// Gtk.Object.custom - Gtk Object class customizations // // Author: Mike Kestner // -// (c) 2002 Mike Kestner +// (c) 2002-2003 Mike Kestner // // This code is inserted after the automatically generated code. diff --git a/gtk/Window.custom b/gtk/Window.custom index f3e93ca76..5012c9286 100755 --- a/gtk/Window.custom +++ b/gtk/Window.custom @@ -7,6 +7,19 @@ // This code is inserted after the automatically generated code. + [DllImport("libgobject-2.0-0.dll")] + private static extern void g_object_ref (IntPtr raw); + + protected override IntPtr Raw { + get { + return base.Raw; + } + set { + base.Raw = value; + g_object_ref (value); + } + } + /// /// Window Constructor ///