Fix crash on OSX when page was changed before hack array was alloc'ed.
This commit is contained in:
parent
dac78d2562
commit
84944524cc
|
@ -87,6 +87,9 @@ PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle,
|
|||
// Finish initialization after the bookctrl pages have been added.
|
||||
void PAGED_DIALOG::finishInitialization()
|
||||
{
|
||||
for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
|
||||
// For some reason adding page labels to the treeCtrl doesn't invalidate its bestSize
|
||||
// cache so we have to do it by hand
|
||||
m_treebook->GetTreeCtrl()->InvalidateBestSize();
|
||||
|
@ -100,9 +103,6 @@ void PAGED_DIALOG::finishInitialization()
|
|||
m_treebook->Fit();
|
||||
m_treebook->Layout();
|
||||
|
||||
for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
|
||||
FinishDialogSettings();
|
||||
}
|
||||
|
||||
|
|
|
@ -61,14 +61,14 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
|
|||
m_treebook->AddPage( new wxPanel( this ), _( "Project" ) );
|
||||
m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) );
|
||||
|
||||
for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
|
||||
// Connect Events
|
||||
m_treebook->Connect( wxEVT_TREEBOOK_PAGE_CHANGED,
|
||||
wxBookCtrlEventHandler( DIALOG_SCHEMATIC_SETUP::OnPageChange ), NULL, this );
|
||||
|
||||
FinishDialogSettings();
|
||||
|
||||
for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -76,14 +76,14 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
|
|||
m_treebook->AddPage( new wxPanel( this ), _( "Project" ) );
|
||||
m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) );
|
||||
|
||||
for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
|
||||
// Connect Events
|
||||
m_treebook->Connect( wxEVT_TREEBOOK_PAGE_CHANGED,
|
||||
wxBookCtrlEventHandler( DIALOG_BOARD_SETUP::OnPageChange ), NULL, this );
|
||||
|
||||
FinishDialogSettings();
|
||||
|
||||
for( size_t i = 0; i < m_treebook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -68,6 +68,9 @@ DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR( PCB_EDIT_FRAME* aP
|
|||
m_frame = aParent;
|
||||
m_footprint = aModule;
|
||||
|
||||
for( size_t i = 0; i < m_NoteBook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
|
||||
m_texts = new TEXT_MOD_GRID_TABLE( m_units, m_frame );
|
||||
|
||||
m_delayedErrorMessage = wxEmptyString;
|
||||
|
@ -155,9 +158,6 @@ DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR( PCB_EDIT_FRAME* aP
|
|||
m_buttonRemove->SetBitmap( KiBitmap( trash_xpm ) );
|
||||
|
||||
FinishDialogSettings();
|
||||
|
||||
for( size_t i = 0; i < m_NoteBook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue