From 2f416348f694e87de9742a67cc8a982379d26bd6 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 13 Jul 2016 15:43:21 +0200 Subject: [PATCH] message: fix annotation of parse_device_{added,removed} gst_structure_id_get() returns a new reference so the returned device is actually (transfer full). The code using this API was already correct but the code example in comments was not. https://bugzilla.gnome.org/show_bug.cgi?id=768776 --- gst/gstdevicemonitor.c | 2 ++ gst/gstmessage.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/gstdevicemonitor.c b/gst/gstdevicemonitor.c index 0d31eb093d..d03a8139b6 100644 --- a/gst/gstdevicemonitor.c +++ b/gst/gstdevicemonitor.c @@ -49,12 +49,14 @@ * name = gst_device_get_display_name (device); * g_print("Device added: %s\n", name); * g_free (name); + * gst_object_unref (device); * break; * case GST_MESSAGE_DEVICE_REMOVED: * gst_message_parse_device_removed (message, &device); * name = gst_device_get_display_name (device); * g_print("Device removed: %s\n", name); * g_free (name); + * gst_object_unref (device); * break; * default: * break; diff --git a/gst/gstmessage.c b/gst/gstmessage.c index 299ecfb1ab..00befcbfae 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -2379,7 +2379,7 @@ gst_message_new_device_added (GstObject * src, GstDevice * device) /** * gst_message_parse_device_added: * @message: a #GstMessage of type %GST_MESSAGE_DEVICE_ADDED - * @device: (out) (allow-none) (transfer none): A location where to store a + * @device: (out) (allow-none) (transfer full): A location where to store a * pointer to the new #GstDevice, or %NULL * * Parses a device-added message. The device-added message is produced by @@ -2431,7 +2431,7 @@ gst_message_new_device_removed (GstObject * src, GstDevice * device) /** * gst_message_parse_device_removed: * @message: a #GstMessage of type %GST_MESSAGE_DEVICE_REMOVED - * @device: (out) (allow-none) (transfer none): A location where to store a + * @device: (out) (allow-none) (transfer full): A location where to store a * pointer to the removed #GstDevice, or %NULL * * Parses a device-removed message. The device-removed message is produced by