[gnome-desktop] thumbnail: Fix a code path where the mutex is never unlocked
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop] thumbnail: Fix a code path where the mutex is never unlocked
- Date: Thu, 11 Dec 2014 00:02:53 +0000 (UTC)
commit 5b28350d3229d36d7c64084e52f5a40ee5903723
Author: Philip Withnall <philip tecnocode co uk>
Date: Wed Dec 10 23:41:11 2014 +0000
thumbnail: Fix a code path where the mutex is never unlocked
Fix one unusual code path where the GnomeDesktopThumbnailFactory’s mutex
is not unlocked before the function returns. As well as the usual
deadlock issues, this would lead to an abort on shutdown with recent
GLib changes, as g_mutex_clear() would be called on the locked mutex,
which GLib now (correctly) complains about.
https://bugzilla.gnome.org/show_bug.cgi?id=740666
libgnome-desktop/gnome-desktop-thumbnail.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
index eb50f37..7a1963b 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail.c
@@ -941,10 +941,11 @@ external_thumbnailers_disabled_changed_cb (GSettings *setting
g_mutex_lock (&priv->lock);
- if (priv->disabled)
- return;
- g_strfreev (priv->disabled_types);
- priv->disabled_types = g_settings_get_strv (priv->settings, "disable");
+ if (!priv->disabled)
+ {
+ g_strfreev (priv->disabled_types);
+ priv->disabled_types = g_settings_get_strv (priv->settings, "disable");
+ }
g_mutex_unlock (&priv->lock);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]