Fixed wxLogTrace for LIB_ALIAS

When a LIB_PART object is removed, it deletes all of its aliases.
When the last one is removed, it tries to report the name of the
parent part, but as it has no aliases - it cannot return a valid name.
This commit is contained in:
Maciej Suminski 2018-01-09 09:50:31 +01:00
parent ee140ce6c8
commit 82fc038c9b
1 changed files with 4 additions and 6 deletions

View File

@ -85,12 +85,10 @@ LIB_ALIAS::LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootPart ) :
LIB_ALIAS::~LIB_ALIAS() LIB_ALIAS::~LIB_ALIAS()
{ {
wxASSERT_MSG( shared, wxT( "~LIB_ALIAS() without a LIB_PART" ) ); wxLogTrace( traceSchLibMem, wxT( "%s: destroying alias:'%s'" ),
GetChars( wxString::FromAscii( __WXFUNCTION__ ) ), GetChars( GetName() ) );
wxLogTrace( traceSchLibMem, wxCHECK_RET( shared, wxT( "~LIB_ALIAS() without a LIB_PART" ) );
wxT( "%s: destroying alias:'%s' of part:'%s'." ),
GetChars( wxString::FromAscii( __WXFUNCTION__ ) ), GetChars( name ),
GetChars( shared->GetName() ) );
if( shared ) if( shared )
shared->RemoveAlias( this ); shared->RemoveAlias( this );
@ -209,7 +207,7 @@ LIB_PART::LIB_PART( LIB_PART& aPart, PART_LIB* aLibrary ) :
LIB_PART::~LIB_PART() LIB_PART::~LIB_PART()
{ {
wxLogTrace( traceSchLibMem, wxLogTrace( traceSchLibMem,
wxT( "%s: destroying part with alias list count of %llu." ), wxT( "%s: destroying part with alias list count of %llu" ),
GetChars( wxString::FromAscii( __WXFUNCTION__ ) ), GetChars( wxString::FromAscii( __WXFUNCTION__ ) ),
(long long unsigned) m_aliases.size() ); (long long unsigned) m_aliases.size() );