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:
parent
bd73a39a4b
commit
83cf726cd6
|
@ -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.
|
||||
|
@ -672,7 +665,7 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject, bool aShowProgress )
|
|||
{
|
||||
// Use a different exception type so catch()er can route to proper use
|
||||
// of the HTML_MESSAGE_BOX.
|
||||
THROW_PARSE_ERROR( wxEmptyString, __func__, TO_UTF8(libs_not_found), 0, 0 );
|
||||
THROW_PARSE_ERROR( wxEmptyString, __func__, TO_UTF8( libs_not_found ), 0, 0 );
|
||||
}
|
||||
|
||||
#if defined(DEBUG) && 1
|
||||
|
|
Loading…
Reference in New Issue