From ba3fbaf1d8ff59bb5a870eee27f9222cdcf3f6ef Mon Sep 17 00:00:00 2001 From: Nick Schermer Date: Sun, 5 May 2013 12:15:58 +0200 Subject: Don't recalculate the length of the array. Instead check the object. --- tumblerd/tumbler-registry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tumblerd/tumbler-registry.c') diff --git a/tumblerd/tumbler-registry.c b/tumblerd/tumbler-registry.c index 1a2e02b..dabfb92 100644 --- a/tumblerd/tumbler-registry.c +++ b/tumblerd/tumbler-registry.c @@ -453,14 +453,14 @@ 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); - for (length = 0; infos != NULL && infos[length] != NULL; ++length); - /* allocate the thumbnailer array */ thumbnailers = g_new0 (TumblerThumbnailer *, length + 1); /* iterate over all URIs */ for (n = 0; n < length; ++n) { + g_assert (TUMBLER_IS_FILE_INFO (infos[n])); + tumbler_mutex_lock (registry->mutex); /* reset */ -- cgit v1.2.1