registry: Substitute deprecated GLib symbol: g_mapped_file_free

Use g_mapped_file_unref if Glib >= 2.22 is available

Fixes bug #560442.
This commit is contained in:
Javier Jardón 2009-12-03 19:48:11 +01:00 committed by Sebastian Dröge
parent f490508490
commit ca974b1a8f

View file

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