fix a segfault in library editor when importing symbols.

Fixes: lp:1722869
https://bugs.launchpad.net/kicad/+bug/1722869
This commit is contained in:
jean-pierre charras 2017-10-12 10:38:48 +02:00
parent f685cfaf3d
commit afd2d4f016
1 changed files with 7 additions and 1 deletions

View File

@ -232,10 +232,16 @@ public:
m_data[ i ].sort(); m_data[ i ].sort();
} }
/**
* Remove duplicate elements in list
*/
void unique() void unique()
{ {
for( int i = 0; i < TYPES_COUNT; ++i ) for( int i = 0; i < TYPES_COUNT; ++i )
m_data[ i ].unique(); {
if( m_data[ i ].size() > 1 )
m_data[ i ].unique();
}
} }
ITEM_PTR_VECTOR& operator[]( int aType ) ITEM_PTR_VECTOR& operator[]( int aType )