Fix crash switching footprints with 3dviewer OPENGL

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16802
This commit is contained in:
Marek Roszko 2024-01-28 16:04:02 -05:00
parent 22288adb7d
commit 93b9fb9124
1 changed files with 4 additions and 3 deletions

View File

@ -388,12 +388,13 @@ void EDA_3D_VIEWER_FRAME::handleIconizeEvent( wxIconizeEvent& aEvent )
void EDA_3D_VIEWER_FRAME::ReloadRequest()
{
if( m_appearancePanel )
m_appearancePanel->UpdateLayerCtls();
// This will schedule a request to load later
// ReloadRequest also updates the board pointer so always call it first
if( m_canvas )
m_canvas->ReloadRequest( GetBoard(), PROJECT_PCB::Get3DCacheManager( &Prj() ) );
if( m_appearancePanel )
m_appearancePanel->UpdateLayerCtls();
}