gst: Clear floating flag in constructor of all GstObject subclasses that are not...
[platform/upstream/gstreamer.git] / gst / gstdevicemonitor.c
index 123d284..add267e 100644 (file)
@@ -785,14 +785,21 @@ gst_device_monitor_remove_filter (GstDeviceMonitor * monitor, guint filter_id)
  *
  * Create a new #GstDeviceMonitor
  *
- * Returns: (transfer floating): a new device monitor.
+ * Returns: (transfer full): a new device monitor.
  *
  * Since: 1.4
  */
 GstDeviceMonitor *
 gst_device_monitor_new (void)
 {
-  return g_object_new (GST_TYPE_DEVICE_MONITOR, NULL);
+  GstDeviceMonitor *monitor;
+
+  monitor = g_object_new (GST_TYPE_DEVICE_MONITOR, NULL);
+
+  /* Clear floating flag */
+  gst_object_ref_sink (monitor);
+
+  return monitor;
 }
 
 /**