From 8d23b26f2ac8b04e3d04be4db5ea7025c81d18e6 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 26 Aug 2014 17:16:30 +0200 Subject: [PATCH] Eeschema, Libedit: fix crash in undo/redo commands (due to double deletion) (bug #1358217 ) --- eeschema/libedit_undo_redo.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/eeschema/libedit_undo_redo.cpp b/eeschema/libedit_undo_redo.cpp index fa59cb5db8..1012f0e17b 100644 --- a/eeschema/libedit_undo_redo.cpp +++ b/eeschema/libedit_undo_redo.cpp @@ -51,7 +51,11 @@ void LIB_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event ) part = (LIB_PART*) wrapper.GetItem(); - SetCurPart( part ); + // Do not delete the previous part by calling SetCurPart( part ) + // which calls delete . + // is now put in undo list and is owned by this list + // Just set the current part to the part which come from the redo list + m_my_part = part; if( !part ) return; @@ -90,7 +94,11 @@ void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event ) part = (LIB_PART* ) wrapper.GetItem(); - SetCurPart( part ); + // Do not delete the previous part by calling SetCurPart( part ), + // which calls delete . + // is now put in redo list and is owned by this list. + // Just set the current part to the part which come from the undo list + m_my_part = part; if( !part ) return;