Fix Linux crash opening CvPcb.

This commit is contained in:
Jeff Young 2018-03-26 00:52:02 +01:00
parent ba49bd0386
commit b3e3964787
3 changed files with 6 additions and 9 deletions

View File

@ -118,6 +118,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_filteringOptions = 0;
m_tcFilterString = NULL;
m_FootprintsList = FOOTPRINT_LIST::GetInstance( Kiway() );
m_initialized = false;
// Give an icon
wxIcon icon;
@ -209,6 +210,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr.AddPane( bottomPanel, wxAuiPaneInfo( horiz ).Name( wxT( "buttons" ) ).Bottom() );
m_auimgr.Update();
m_initialized = true;
// Connect Events
m_saveAndContinue->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this );
@ -645,8 +647,8 @@ void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
void CVPCB_MAINFRAME::DisplayStatus()
{
if( !m_libListBox || !m_compListBox || !m_footprintListBox )
return; // still initializing; not ready for status yet
if( !m_initialized )
return;
wxString filters, msg;
COMPONENT* component = GetSelectedComponent();

View File

@ -77,12 +77,13 @@ public:
FOOTPRINT_LIST* m_FootprintsList;
protected:
int m_undefinedComponentCnt;
bool m_modified;
bool m_skipComponentSelect; // true to skip OnSelectComponent event
// (in automatic selection/deletion of associations)
PARAM_CFG_ARRAY m_projectFileParams;
bool m_initialized;
CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent );
public:

View File

@ -361,12 +361,6 @@ bool CVPCB_MAINFRAME::ReadNetListAndFpFiles( const std::string& aNetlist )
GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) );
m_compListBox->AppendLine( msg );
if( component->GetFPID().empty() )
{
m_undefinedComponentCnt += 1;
continue;
}
}
if( !m_netlist.IsEmpty() )