[Xfce4-commits] <tumbler:master> Put thread lock outside loop.
Nick Schermer
noreply at xfce.org
Sun May 5 12:22:01 CEST 2013
Updating branch refs/heads/master
to cadcc633ad33ff77b87d13a973bfbb3bb7ab9467 (commit)
from ba3fbaf1d8ff59bb5a870eee27f9222cdcf3f6ef (commit)
commit cadcc633ad33ff77b87d13a973bfbb3bb7ab9467
Author: Nick Schermer <nick at xfce.org>
Date: Sun May 5 12:20:46 2013 +0200
Put thread lock outside loop.
Maybe safer since there are some strange segfaults in this region.
tumblerd/tumbler-registry.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tumblerd/tumbler-registry.c b/tumblerd/tumbler-registry.c
index dabfb92..77bc74f 100644
--- a/tumblerd/tumbler-registry.c
+++ b/tumblerd/tumbler-registry.c
@@ -453,6 +453,8 @@ tumbler_registry_get_thumbnailer_array (TumblerRegistry *registry,
g_return_val_if_fail (TUMBLER_IS_REGISTRY (registry), NULL);
g_return_val_if_fail (infos != NULL, NULL);
+ tumbler_mutex_lock (registry->mutex);
+
/* allocate the thumbnailer array */
thumbnailers = g_new0 (TumblerThumbnailer *, length + 1);
@@ -461,8 +463,6 @@ tumbler_registry_get_thumbnailer_array (TumblerRegistry *registry,
{
g_assert (TUMBLER_IS_FILE_INFO (infos[n]));
- tumbler_mutex_lock (registry->mutex);
-
/* reset */
file_size = 0;
@@ -503,13 +503,13 @@ tumbler_registry_get_thumbnailer_array (TumblerRegistry *registry,
g_object_unref (gfile);
g_list_foreach (list, (GFunc) g_object_unref, NULL);
g_list_free (list);
-
- tumbler_mutex_unlock (registry->mutex);
}
/* NULL-terminate the array */
thumbnailers[n] = NULL;
+ tumbler_mutex_unlock (registry->mutex);
+
return thumbnailers;
}
More information about the Xfce4-commits
mailing list