[gst-devel] Why do we call gst_object_unref() ?

gst_call_me_newbie() 21stninjagod at gmail.com
Sun Jan 2 07:43:18 CET 2011


hi all,

I checked the meaning of the function gst_object_unref() and got what it
does but I could not get why do we call it while the program is in
execution.

for e.g this is a code snippet from the application developer manual
provided at the gstreamer's site.

[some code here.....]
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_bus_add_watch (bus, my_bus_callback, loop);
gst_object_unref (bus);
[some other code here.....]

so why would someone want to unref the bus when we still need it in our
program. If I unref it and if somehow that would have been the last
reference to the object than object would surely be destroyed.
so why should I call it. Please enlighten me.
Thanks 


-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Why-do-we-call-gst-object-unref-tp3170699p3170699.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list