Make sure Gst.Bus.SyncHandler handlers are not garbage collected too early

This commit is contained in:
Sebastian Dröge 2009-10-01 16:10:44 +02:00
parent 4cdbee8249
commit aff62828ea
2 changed files with 13 additions and 0 deletions

View file

@ -19,3 +19,15 @@ public bool AsyncSignalFunc (Gst.Message message) {
bool ret = raw_ret;
return ret;
}
[DllImport ("libgstreamer-0.10.dll", CallingConvention = CallingConvention.Cdecl) ]
static extern void gst_bus_set_sync_handler (IntPtr raw, GstSharp.BusSyncHandlerNative func, IntPtr data);
private GstSharp.BusSyncHandlerWrapper sync_handler = null;
public Gst.BusSyncHandler SyncHandler {
set {
GstSharp.BusSyncHandlerWrapper value_wrapper = new GstSharp.BusSyncHandlerWrapper (value);
sync_handler = value_wrapper;
gst_bus_set_sync_handler (Handle, value_wrapper.NativeDelegate, IntPtr.Zero);
}
}

View file

@ -99,6 +99,7 @@
<attr path="/api/namespace/object[@name='Bus']/method[@cname='gst_bus_async_signal_func']" name="hidden">1</attr>
<attr path="/api/namespace/object[@name='Bus']/method[@cname='gst_bus_add_signal_watch_full']" name="name">AddSignalWatch</attr>
<attr path="/api/namespace/object[@name='Bus']/method[@cname='gst_bus_poll']/return-type" name="owned">true</attr>
<attr path="/api/namespace/object[@name='Bus']/method[@cname='gst_bus_set_sync_handler']" name="hidden">1</attr>
<attr path="/api/namespace/enum[@name='BusFlags']/member[@cname='GST_BUS_FLAG_LAST']" name="name">Last</attr>
<attr path="/api/namespace/enum[@name='BusFlags']/member[@cname='GST_BUS_FLUSHING']" name="value">MiniObjectFlags.Last &lt;&lt; 0</attr>