From f776e2df96e372758ba913bdf2cde31c8abbd78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2019 21:22:18 +0200 Subject: [PATCH] decklink: Return new references to the devices from get_devices() Otherwise the caller will free the devices we store internally. --- sys/decklink/gstdecklink.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index 25493ce2a9..4978ee40fa 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -1590,16 +1590,16 @@ gst_decklink_get_devices (void) Device *device = (Device *) g_ptr_array_index (devices, i); if (device->devices[0]) - l = g_list_prepend (l, device->devices[0]); + l = g_list_prepend (l, g_object_ref (device->devices[0])); if (device->devices[1]) - l = g_list_prepend (l, device->devices[1]); + l = g_list_prepend (l, g_object_ref (device->devices[1])); if (device->devices[2]) - l = g_list_prepend (l, device->devices[2]); + l = g_list_prepend (l, g_object_ref (device->devices[2])); if (device->devices[3]) - l = g_list_prepend (l, device->devices[3]); + l = g_list_prepend (l, g_object_ref (device->devices[3])); } l = g_list_reverse (l);