Fix assert when removing CurPart

Fixes: lp:1762099
* https://bugs.launchpad.net/kicad/+bug/1762099
This commit is contained in:
Seth Hillbrand 2018-04-17 12:19:21 -07:00
parent 853f73e6b7
commit 2d5da8b04f
1 changed files with 6 additions and 1 deletions

View File

@ -1024,11 +1024,16 @@ wxString LIB_EDIT_FRAME::SetCurLib( const wxString& aLibNickname )
void LIB_EDIT_FRAME::SetCurPart( LIB_PART* aPart )
{
if( !aPart && !m_my_part )
return;
wxASSERT( m_my_part != aPart );
if( m_my_part != aPart )
{
delete m_my_part;
if( m_my_part )
delete m_my_part;
m_my_part = aPart;
}