[Gtk-sharp-list] Increasing Ref count manually

MDK mdk at mdk.org.pl
Wed Jun 8 17:47:01 EDT 2005


I've got a strange problem. I'd like to manually increase the ref count
of a Glib.Object. The exact opposite to Unref(); Is it somehow possible,
without digging to much? 

The reason I need this is: a bug in gst-sharp (I suppose). There is a
function Gst.Bin.Remove(Gst.Bin Bin1) that removes Bin1 from the calling
Bin. In the gstreamer api this function is described as follows:

*** gst_bin_remove () :
"Remove the element from its associated bin, unparenting it as well.
Unparenting the element means that the element will be dereferenced, so
if the bin holds the only reference to the element, the element will be
freed in the process of removing it from the bin. If you want the
element to still exist after removing, you need to call gst_object_ref
before removing it from the bin."

And this is exactly what happens. After the Remove (in mono) the Bin
that is to be removed is deallocated. This is not what I want. 

Michał Dominik K.
mdk at mdk.org.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://galactus.ximian.com/pipermail/gtk-sharp-list/attachments/20050608/22272f42/attachment.bin

More information about the Gtk-sharp-list mailing list