From e4eedfa893d11bc3487fbb79121eedc75cc1b6f1 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 13 Jan 2020 15:00:39 +0000 Subject: [PATCH] Catch exceptions from failed clone. --- eeschema/class_libentry.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 68266e5dd2..e4351b4ca9 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -139,9 +139,16 @@ LIB_PART::LIB_PART( const LIB_PART& aPart, PART_LIB* aLibrary ) : if( ( oldItem.GetFlags() & ( IS_NEW | STRUCT_DELETED ) ) != 0 ) continue; - newItem = (LIB_ITEM*) oldItem.Clone(); - newItem->SetParent( this ); - m_drawings.push_back( newItem ); + try + { + newItem = (LIB_ITEM*) oldItem.Clone(); + newItem->SetParent( this ); + m_drawings.push_back( newItem ); + } + catch( ... ) + { + wxFAIL_MSG( "Failed to clone LIB_ITEM." ); + } } PART_SPTR parent = aPart.m_parent.lock();