2008-04-15 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: use new GLib.Opaque.OwnedCopy for owned opaque return values. * glib/Opaque.cs: introduce OwnedCopy property to support returning owned opaque instances from native to managed callbacks. [Fixes #374641] svn path=/trunk/gtk-sharp/; revision=100762
This commit is contained in:
parent
a1c4fb0689
commit
11286d19c6
3 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
|||
2008-04-15 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* generator/ReturnValue.cs: use new GLib.Opaque.OwnedCopy for owned
|
||||
opaque return values.
|
||||
* glib/Opaque.cs: introduce OwnedCopy property to support returning
|
||||
owned opaque instances from native to managed callbacks.
|
||||
[Fixes #374641]
|
||||
|
||||
2008-04-15 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gtk/Gtk.metadata: hide GtkKey_ for manual impl.
|
||||
|
|
|
@ -150,6 +150,8 @@ namespace GtkSharp.Generation {
|
|||
return (IGen as IManualMarshaler).AllocNative (var);
|
||||
else if (IGen is ObjectGen && owned)
|
||||
return var + " == null ? IntPtr.Zero : " + var + ".OwnedHandle";
|
||||
else if (IGen is OpaqueGen && owned)
|
||||
return var + " == null ? IntPtr.Zero : " + var + ".OwnedCopy";
|
||||
else
|
||||
return IGen.ToNativeReturn (var);
|
||||
}
|
||||
|
|
|
@ -113,6 +113,14 @@ namespace GLib {
|
|||
}
|
||||
}
|
||||
|
||||
public IntPtr OwnedCopy {
|
||||
get {
|
||||
Opaque result = Copy (Handle);
|
||||
result.Owned = false;
|
||||
return result.Handle;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Owned {
|
||||
get {
|
||||
return owned;
|
||||
|
|
Loading…
Reference in a new issue