[gimp] app: don't rely on gimp_brush_tool_create_outline() returning an outline



commit b77b94d3edca9af5ccb70edcf39ea02f2aed0680
Author: Michael Natterer <mitch gimp org>
Date:   Thu May 5 12:19:25 2011 +0200

    app: don't rely on gimp_brush_tool_create_outline() returning an outline
    
    It can just as well return NULL.

 app/tools/gimpsourcetool.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/app/tools/gimpsourcetool.c b/app/tools/gimpsourcetool.c
index 4678f5c..ddaa923 100644
--- a/app/tools/gimpsourcetool.c
+++ b/app/tools/gimpsourcetool.c
@@ -392,9 +392,13 @@ gimp_source_tool_draw (GimpDrawTool *draw_tool)
                                             source_tool->src_x + off_x,
                                             source_tool->src_y + off_y,
                                             FALSE);
-          gimp_display_shell_add_item (src_shell,
-                                       source_tool->src_outline);
-          g_object_unref (source_tool->src_outline);
+
+          if (source_tool->src_outline)
+            {
+              gimp_display_shell_add_item (src_shell,
+                                           source_tool->src_outline);
+              g_object_unref (source_tool->src_outline);
+            }
         }
 
       if (! source_tool->src_handle)



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