[gnome-builder/wip/libide] libide: fix service discovery logic bomb



commit c67b197ba04ec506929c3f89f52aa13c154f5be5
Author: Christian Hergert <christian hergert me>
Date:   Sun Feb 15 00:17:39 2015 -0800

    libide: fix service discovery logic bomb

 libide/ide-context.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/libide/ide-context.c b/libide/ide-context.c
index 9aa7ed0..7f37388 100644
--- a/libide/ide-context.c
+++ b/libide/ide-context.c
@@ -374,16 +374,13 @@ ide_context_get_service_typed (IdeContext *context,
 
   while (g_hash_table_iter_next (&iter, &key, &value))
     {
-      service = value;
+      IdeService *item = value;
 
-      if (g_type_is_a (G_TYPE_FROM_INSTANCE (service), service_type))
-        return service;
+      if (g_type_is_a (G_TYPE_FROM_INSTANCE (item), service_type))
+        return item;
     }
 
-  if (!service)
-    service = ide_context_create_service (context, service_type);
-
-  return service;
+  return ide_context_create_service (context, service_type);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]