diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index a6fda9cfd1..29b6a53b84 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -73,6 +73,7 @@ EDA_ITEM* LIB_TEXT::Clone() const { LIB_TEXT* newitem = new LIB_TEXT( nullptr ); + newitem->m_parent = m_parent; newitem->m_unit = m_unit; newitem->m_convert = m_convert; newitem->m_flags = m_flags; diff --git a/eeschema/tools/ee_tool_base.h b/eeschema/tools/ee_tool_base.h index 0bbac77cb5..3ed5a33660 100644 --- a/eeschema/tools/ee_tool_base.h +++ b/eeschema/tools/ee_tool_base.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 CERN - * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -133,6 +133,8 @@ protected: ///< parents. void saveCopyInUndoList( EDA_ITEM* aItem, UNDO_REDO aType, bool aAppend = false ) { + wxASSERT( aItem ); + KICAD_T itemType = aItem->Type(); bool selected = aItem->IsSelected();