[Xfce4-commits] <thunar:master> Clear mutex to avoid memleak with 2.32 api.

Nick Schermer noreply at xfce.org
Sat Dec 8 11:36:02 CET 2012


Updating branch refs/heads/master
         to 2921f6241d8e34b7ea22310b161868e84782330b (commit)
       from 834ed0c407016c2760d9f7cad12f6f8343f0964f (commit)

commit 2921f6241d8e34b7ea22310b161868e84782330b
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Dec 8 11:33:50 2012 +0100

    Clear mutex to avoid memleak with 2.32 api.
    
    Tiny leak, but still..

 thunar/thunar-thumbnail-cache.c |    4 +++-
 thunar/thunar-thumbnailer.c     |    6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/thunar/thunar-thumbnail-cache.c b/thunar/thunar-thumbnail-cache.c
index d29b475..c7ff0c8 100644
--- a/thunar/thunar-thumbnail-cache.c
+++ b/thunar/thunar-thumbnail-cache.c
@@ -174,8 +174,10 @@ thunar_thumbnail_cache_finalize (GObject *object)
   /* release the cache lock */
   _thumbnail_cache_unlock (cache);
 
-#if !GLIB_CHECK_VERSION (2, 32, 0)
   /* release the mutex itself */
+#if GLIB_CHECK_VERSION (2, 32, 0)
+  g_mutex_clear (&cache->lock);
+#else
   g_mutex_free (cache->lock);
 #endif
 #endif
diff --git a/thunar/thunar-thumbnailer.c b/thunar/thunar-thumbnailer.c
index 8e2faaf..195dc21 100644
--- a/thunar/thunar-thumbnailer.c
+++ b/thunar/thunar-thumbnailer.c
@@ -320,8 +320,10 @@ thunar_thumbnailer_finalize (GObject *object)
   /* release the thumbnailer lock */
   _thumbnailer_unlock (thumbnailer);
 
-#if !GLIB_CHECK_VERSION (2, 32, 0)
-  /* release the mutex */
+/* release the mutex */
+#if GLIB_CHECK_VERSION (2, 32, 0)
+  g_mutex_clear (&thumbnailer->lock);
+#else
   g_mutex_free (thumbnailer->lock);
 #endif
 #endif


More information about the Xfce4-commits mailing list