gimp r27996 - trunk/app/core



Author: martinn
Date: Sat Feb  7 09:31:06 2009
New Revision: 27996
URL: http://svn.gnome.org/viewvc/gimp?rev=27996&view=rev

Log:
Introduce and use gimp_image_map_kill_any_idle_processors()

Introduce and use a local helper function
gimp_image_map_kill_any_idle_processors() to get a rid of some code
duplication.

Modified:
   trunk/app/core/gimpimagemap.c

Modified: trunk/app/core/gimpimagemap.c
==============================================================================
--- trunk/app/core/gimpimagemap.c	(original)
+++ trunk/app/core/gimpimagemap.c	Sat Feb  7 09:31:06 2009
@@ -101,6 +101,8 @@
                                                       GimpImageMap        *image_map);
 static void            gimp_image_map_cancel_any_idle_jobs
                                                      (GimpImageMap        *image_map);
+static void            gimp_image_map_kill_any_idle_processors
+                                                     (GimpImageMap        *image_map);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpImageMap, gimp_image_map, GIMP_TYPE_OBJECT,
@@ -658,17 +660,7 @@
     {
       image_map->idle_id = 0;
 
-      if (image_map->processor)
-        {
-          g_object_unref (image_map->processor);
-          image_map->processor = NULL;
-        }
-
-      if (image_map->PRI)
-        {
-          pixel_regions_process_stop (image_map->PRI);
-          image_map->PRI = NULL;
-        }
+      gimp_image_map_kill_any_idle_processors (image_map);
 
       return FALSE;
     }
@@ -843,16 +835,22 @@
       g_source_remove (image_map->idle_id);
       image_map->idle_id = 0;
 
-      if (image_map->processor)
-        {
-          g_object_unref (image_map->processor);
-          image_map->processor = NULL;
-        }
+      gimp_image_map_kill_any_idle_processors (image_map);
+    }
+}
 
-      if (image_map->PRI)
-        {
-          pixel_regions_process_stop (image_map->PRI);
-          image_map->PRI = NULL;
-        }
+static void
+gimp_image_map_kill_any_idle_processors (GimpImageMap *image_map)
+{
+  if (image_map->processor)
+    {
+      g_object_unref (image_map->processor);
+      image_map->processor = NULL;
+    }
+
+  if (image_map->PRI)
+    {
+      pixel_regions_process_stop (image_map->PRI);
+      image_map->PRI = NULL;
     }
 }



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