Fix crash when no symbol libraries are found.

Remove adding the power symbol library when no libraries are specified
in the project file to prevent unexpected missing library dialog.

Only show progress dialog if there are actually libraries to load.

Do not call wxWindow::Destroy().  The dialog is created on the stack and
will be destroyed properly in the wxWindow dtor.

Fixes lp:1728648

https://bugs.launchpad.net/kicad/+bug/1728648
This commit is contained in:
Wayne Stambaugh 2017-10-31 18:37:44 -04:00
parent bd73a39a4b
commit 83cf726cd6
1 changed files with 58 additions and 65 deletions

View File

@ -546,6 +546,7 @@ const wxString PART_LIBS::CacheName( const wxString& aFullProjectFilename )
return new_name.GetFullPath();
}
}
return wxEmptyString;
}
@ -564,12 +565,8 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress )
LibNamesAndPaths( aProject, false, NULL, &lib_names );
// If the list is empty, force loading the standard power symbol library.
if( !lib_names.GetCount() )
lib_names.Add( "power" );
wxASSERT( !size() ); // expect to load into "this" empty container.
if( !lib_names.empty() )
{
wxProgressDialog lib_dialog( _( "Loading Symbol Libraries" ),
wxEmptyString,
lib_names.GetCount(),
@ -636,10 +633,6 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress )
wxLogError( msg );
}
}
if( aShowProgress )
{
lib_dialog.Destroy();
}
// add the special cache library.