registry: Substitute deprecated GLib symbol: g_mapped_file_free
authorJavier Jardón <jjardon@gnome.org>
Thu, 3 Dec 2009 18:48:11 +0000 (19:48 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 4 Dec 2009 13:50:46 +0000 (14:50 +0100)
Use g_mapped_file_unref if Glib >= 2.22 is available

Fixes bug #560442.

gst/gstregistrybinary.c

index 576ab02..42b010e 100644 (file)
@@ -524,7 +524,11 @@ gst_registry_binary_read_cache (GstRegistry * registry, const char *location)
   if (contents == NULL) {
     /* Error mmap-ing the cache, try a plain memory read */
     if (mapped) {
+#if GLIB_CHECK_VERSION(2,22,0)
+      g_mapped_file_unref (mapped);
+#else
       g_mapped_file_free (mapped);
+#endif
       mapped = NULL;
     }
 
@@ -602,7 +606,11 @@ Error:
   g_timer_destroy (timer);
 #endif
   if (mapped) {
+#if GLIB_CHECK_VERSION(2,22,0)
+    g_mapped_file_unref (mapped);
+#else
     g_mapped_file_free (mapped);
+#endif
   } else {
     g_free (contents);
   }