Prevent a crash due to the 3d preview dummy board stealing setting ownership
This commit is contained in:
parent
c50b4fb04f
commit
707a598e5d
|
@ -54,7 +54,7 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
|
|||
m_userUnits = aFrame->GetUserUnits();
|
||||
|
||||
m_dummyBoard = new BOARD();
|
||||
m_dummyBoard->SetProject( &aFrame->Prj() );
|
||||
m_dummyBoard->SetProject( &aFrame->Prj(), true );
|
||||
|
||||
// This board will only be used to hold a footprint for viewing
|
||||
m_dummyBoard->SetBoardUse( BOARD_USE::FPHOLDER );
|
||||
|
|
|
@ -158,14 +158,14 @@ void BOARD::BuildConnectivity( PROGRESS_REPORTER* aReporter )
|
|||
}
|
||||
|
||||
|
||||
void BOARD::SetProject( PROJECT* aProject )
|
||||
void BOARD::SetProject( PROJECT* aProject, bool aReferenceOnly )
|
||||
{
|
||||
if( m_project )
|
||||
ClearProject();
|
||||
|
||||
m_project = aProject;
|
||||
|
||||
if( aProject )
|
||||
if( aProject && !aReferenceOnly )
|
||||
{
|
||||
PROJECT_FILE& project = aProject->GetProjectFile();
|
||||
|
||||
|
|
|
@ -445,8 +445,9 @@ public:
|
|||
* Should be called immediately after loading board in order for everything to work.
|
||||
*
|
||||
* @param aProject is a loaded project to link to.
|
||||
* @param aReferenceOnly avoids taking ownership of settings stored in project if true
|
||||
*/
|
||||
void SetProject( PROJECT* aProject );
|
||||
void SetProject( PROJECT* aProject, bool aReferenceOnly = false );
|
||||
|
||||
void ClearProject();
|
||||
|
||||
|
|
Loading…
Reference in New Issue