[dia] Fix some leaks related to parent_list_affected() usage



commit 59f5acfc089bcb5796f78589ec4ba9cf7f9a00a5
Author: Hans Breuer <hans breuer org>
Date:   Sun Aug 24 19:36:19 2014 +0200

    Fix some leaks related to parent_list_affected() usage

 app/disp_callbacks.c |    3 +--
 app/modify_tool.c    |    5 +++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c
index 750e86e..62f06dc 100644
--- a/app/disp_callbacks.c
+++ b/app/disp_callbacks.c
@@ -246,9 +246,8 @@ _combine_to_path_callback (GtkAction *action, gpointer data)
 
     ddisplay_do_update_menu_sensitivity(ddisp);
     diagram_flush(dia);
-  } else {
-    g_list_free (cut_list);
   }
+  g_list_free (cut_list);
 }
 static void
 add_combine_to_path_menu_items (GtkMenu *menu)
diff --git a/app/modify_tool.c b/app/modify_tool.c
index e463c15..2f7b11c 100644
--- a/app/modify_tool.c
+++ b/app/modify_tool.c
@@ -443,12 +443,12 @@ modify_motion(ModifyTool *tool, GdkEventMotion *event,
   case STATE_MOVE_OBJECT:
 
     if (tool->orig_pos == NULL) {
-      GList *list;
+      GList *list, *pla;
       int i;
       DiaObject *obj;
 
       /* consider non-selected children affected */
-      list = parent_list_affected(ddisp->diagram->data->selected);
+      pla = list = parent_list_affected(ddisp->diagram->data->selected);
       tool->orig_pos = g_new(Point, g_list_length(list));
       i=0;
       while (list != NULL) {
@@ -456,6 +456,7 @@ modify_motion(ModifyTool *tool, GdkEventMotion *event,
        tool->orig_pos[i] = obj->position;
        list = g_list_next(list); i++;
       }
+      g_list_free (pla);
     }
     
     if (tool->break_connections)


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