GstQaBinMonitor *monitor = GST_QA_BIN_MONITOR_CAST (object);
GstElement *bin = GST_QA_ELEMENT_MONITOR_GET_ELEMENT (monitor);
- if (monitor->element_added_id)
+ if (bin && monitor->element_added_id)
g_signal_handler_disconnect (bin, monitor->element_added_id);
g_list_free_full (monitor->element_monitors, g_object_unref);
{
GstQaElementMonitor *monitor = GST_QA_ELEMENT_MONITOR_CAST (object);
- if (monitor->pad_added_id)
+ if (GST_QA_MONITOR_GET_OBJECT (monitor) && monitor->pad_added_id)
g_signal_handler_disconnect (GST_QA_MONITOR_GET_OBJECT (monitor),
monitor->pad_added_id);
GstQaPadMonitor *monitor = GST_QA_PAD_MONITOR_CAST (object);
GstPad *pad = GST_QA_PAD_MONITOR_GET_PAD (monitor);
- if (monitor->buffer_probe_id)
- gst_pad_remove_data_probe (pad, monitor->buffer_probe_id);
- if (monitor->event_probe_id)
- gst_pad_remove_data_probe (pad, monitor->event_probe_id);
+ if (pad) {
+ if (monitor->buffer_probe_id)
+ gst_pad_remove_data_probe (pad, monitor->buffer_probe_id);
+ if (monitor->event_probe_id)
+ gst_pad_remove_data_probe (pad, monitor->event_probe_id);
+
+ g_signal_handlers_disconnect_by_func (pad, (GCallback) _parent_set_cb,
+ monitor);
+ }
if (monitor->expected_segment)
gst_event_unref (monitor->expected_segment);
- g_signal_handlers_disconnect_by_func (pad, (GCallback) _parent_set_cb,
- monitor);
G_OBJECT_CLASS (parent_class)->dispose (object);
}