ges: Fix compilation with latest GLib
authorSebastian Dröge <sebastian@centricular.com>
Mon, 22 Oct 2018 07:13:07 +0000 (08:13 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 22 Oct 2018 07:14:28 +0000 (08:14 +0100)
g_clear_pointer() is now preserving the type of its arguments for the
free function.

ges-xml-formatter.c: In function ‘_dispose’:
ges-xml-formatter.c:1635:7: error: function called through a non-compatible type [-Werror]
       (GDestroyNotify) g_hash_table_unref);
/usr/include/glib-2.0/glib/gmem.h:121:8: note: in definition of macro ‘g_clear_pointer’
       (destroy) (_ptr);                                                        \
        ^~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=797310

ges/ges-base-xml-formatter.c
ges/ges-xml-formatter.c

index ca96792..414fc0c 100644 (file)
@@ -348,12 +348,11 @@ _dispose (GObject * object)
 {
   GESBaseXmlFormatterPrivate *priv = _GET_PRIV (object);
 
-  g_clear_pointer (&priv->assetid_pendingclips,
-      (GDestroyNotify) g_hash_table_unref);
-  g_clear_pointer (&priv->containers, (GDestroyNotify) g_hash_table_unref);
-  g_clear_pointer (&priv->clipid_pendings, (GDestroyNotify) g_hash_table_unref);
-  g_clear_pointer (&priv->tracks, (GDestroyNotify) g_hash_table_unref);
-  g_clear_pointer (&priv->layers, (GDestroyNotify) g_hash_table_unref);
+  g_clear_pointer (&priv->assetid_pendingclips, g_hash_table_unref);
+  g_clear_pointer (&priv->containers, g_hash_table_unref);
+  g_clear_pointer (&priv->clipid_pendings, g_hash_table_unref);
+  g_clear_pointer (&priv->tracks, g_hash_table_unref);
+  g_clear_pointer (&priv->layers, g_hash_table_unref);
 
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
index f0eb2c2..4fe7c65 100644 (file)
@@ -1632,7 +1632,7 @@ static void
 _dispose (GObject * object)
 {
   g_clear_pointer (&GES_XML_FORMATTER (object)->priv->element_id,
-      (GDestroyNotify) g_hash_table_unref);
+      g_hash_table_unref);
 
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }