yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=055899f0cba54c9887b09ad0e7daa4a68604a170

commit 055899f0cba54c9887b09ad0e7daa4a68604a170
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Thu Oct 29 16:54:30 2015 +0200

    Fix memento squash in order to properly unref data
---
 src/lib/undoredo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/undoredo.c b/src/lib/undoredo.c
index 6d981b2..9ec6ef0 100644
--- a/src/lib/undoredo.c
+++ b/src/lib/undoredo.c
@@ -294,7 +294,10 @@ memento_finalize(Memento *memento)
                         cmd->eid == cmd_next->eid &&
                         cmd->new_ptr == cmd_next->old_ptr)
                     {
+                       /* Swap pointers in order to properly unref data. */
+                       void *tmp = cmd->new_ptr;
                        cmd->new_ptr = cmd_next->new_ptr;
+                       cmd_next->new_ptr = tmp;
                        memento->cmds = eina_list_remove_list(memento->cmds, 
next);
                        _cmd_del(cmd_next);
                        change = EINA_TRUE;

-- 


Reply via email to