2005-01-26 Mike Kestner <mkestner@novell.com>
* glib/Value.cs : add a private debugging DllImport for ref_counts since the glue is there already. g_value_get_object returns an unowned ref, so don't pretend like we own it. Make get_Val work for GObject subclasses. [Fixes #71125] svn path=/trunk/gtk-sharp/; revision=39615
This commit is contained in:
parent
c672ddc7a3
commit
8152f4899e
2 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-01-26 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* glib/Value.cs : add a private debugging DllImport for ref_counts
|
||||
since the glue is there already. g_value_get_object returns an
|
||||
unowned ref, so don't pretend like we own it. Make get_Val work for
|
||||
GObject subclasses. [Fixes #71125]
|
||||
|
||||
2005-01-26 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gtk/NodeView.cs : always use CreateNativeObject.
|
||||
|
|
|
@ -143,6 +143,9 @@ namespace GLib {
|
|||
}
|
||||
|
||||
|
||||
[DllImport("glibsharpglue")]
|
||||
static extern int gtksharp_object_get_ref_count (IntPtr obj);
|
||||
|
||||
[DllImport("libgobject-2.0-0.dll")]
|
||||
static extern void g_value_set_object (ref Value val, IntPtr data);
|
||||
|
||||
|
@ -292,7 +295,7 @@ namespace GLib {
|
|||
|
||||
public static explicit operator GLib.Object (Value val)
|
||||
{
|
||||
return GLib.Object.GetObject(g_value_get_object (ref val), true);
|
||||
return GLib.Object.GetObject(g_value_get_object (ref val), false);
|
||||
}
|
||||
|
||||
public static explicit operator GLib.UnwrappedObject (Value val)
|
||||
|
@ -380,7 +383,7 @@ namespace GLib {
|
|||
return (char) this;
|
||||
else if (type == GType.UInt)
|
||||
return (uint) this;
|
||||
else if (type == GType.Object)
|
||||
else if (g_type_is_a (type.Val, GType.Object.Val))
|
||||
return (GLib.Object) this;
|
||||
else
|
||||
throw new Exception ("Unknown type");
|
||||
|
|
Loading…
Reference in a new issue