[gimp] app: SIOX memory leaks



commit 63cc68561a7f5ec55454a1c7365a287afe5be0a6
Author: massimo v <massimo mars central>
Date:   Tue May 24 18:25:19 2011 +0200

    app: SIOX memory leaks

 app/base/siox.c                      |    2 ++
 app/tools/gimpforegroundselecttool.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/app/base/siox.c b/app/base/siox.c
index d690258..597a77c 100644
--- a/app/base/siox.c
+++ b/app/base/siox.c
@@ -1075,6 +1075,7 @@ siox_foreground_extract (SioxState          *state,
 
       if (refinement & SIOX_REFINEMENT_ADD_BACKGROUND)
         {
+          g_free (state->bgsig);
           /* Create color signature for the background */
           state->bgsig = create_signature (surebg, surebgcount,
                                            &state->bgsiglen, limits,
@@ -1096,6 +1097,7 @@ siox_foreground_extract (SioxState          *state,
 
       if (refinement & SIOX_REFINEMENT_ADD_FOREGROUND)
         {
+          g_free (state->fgsig);
           /* Create color signature for the foreground */
           state->fgsig = create_signature (surefg, surefgcount,
                                            &state->fgsiglen, limits,
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index 17a2e8e..a4bb962 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -855,7 +855,7 @@ gimp_foreground_select_options_notify (GimpForegroundSelectOptions *options,
       refinement = SIOX_REFINEMENT_CHANGE_SENSITIVITY;
     }
 
-  if (refinement)
+  if (refinement && fg_select->strokes)
     {
       fg_select->refinement |= refinement;
 



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