From 22443cfb134ad5924e0cd7b2c5167331e13074f6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 7 Dec 2010 11:40:58 +0100 Subject: [PATCH] v4l2: don't abuse the class lock Use a new static lock to protect the probed device list instead of the object class lock. --- sys/v4l2/gstv4l2object.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 8653573..b93a4d0 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -59,21 +59,21 @@ enum V4L2_STD_OBJECT_PROPS, }; +G_LOCK_DEFINE_STATIC (probe_lock); + const GList * gst_v4l2_probe_get_properties (GstPropertyProbe * probe) { GObjectClass *klass = G_OBJECT_GET_CLASS (probe); static GList *list = NULL; - /* well, not perfect, but better than no locking at all. - * In the worst case we leak a list node, so who cares? */ - GST_CLASS_LOCK (GST_OBJECT_CLASS (klass)); + G_LOCK (probe_lock); if (!list) { list = g_list_append (NULL, g_object_class_find_property (klass, "device")); } - GST_CLASS_UNLOCK (GST_OBJECT_CLASS (klass)); + G_UNLOCK (probe_lock); return list; } -- 2.7.4