[evolution] Bug 773236 - Memory leak from e-editor-dom-functions.c:save_history_for_input



commit 1a22e3745f7324da46975734594839650d9590ed
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Oct 25 14:22:06 2016 +0200

    Bug 773236 - Memory leak from e-editor-dom-functions.c:save_history_for_input
    
    Free the history event before removing it from the history.

 .../web-extension/e-editor-undo-redo-manager.c     |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c 
b/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
index 5f3bb17..b31a1bc 100644
--- a/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
+++ b/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
@@ -2241,8 +2241,11 @@ e_editor_undo_redo_manager_set_operation_in_progress (EEditorUndoRedoManager *ma
 }
 
 static void
-free_history_event_content (EEditorHistoryEvent *event)
+free_history_event (EEditorHistoryEvent *event)
 {
+       if (event == NULL)
+               return;
+
        switch (event->type) {
                case HISTORY_INPUT:
                case HISTORY_DELETE:
@@ -2281,15 +2284,6 @@ free_history_event_content (EEditorHistoryEvent *event)
                default:
                        break;
        }
-}
-
-static void
-free_history_event (EEditorHistoryEvent *event)
-{
-       if (event == NULL)
-               return;
-
-       free_history_event_content (event);
 
        g_free (event);
 }
@@ -2298,8 +2292,7 @@ static void
 remove_history_event (EEditorUndoRedoManager *manager,
                       GList *item)
 {
-       free_history_event_content (item->data);
-
+       free_history_event (item->data);
        manager->priv->history = g_list_delete_link (manager->priv->history, item);
        manager->priv->history_size--;
 }


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