Fix a crash in 3D viewer when changing preferences.

It was possible for OnMouseMove to come after ReloadRequest
but before DoRePaint.

Which meant m_3d_render_raytracing->Reload() has't been called yet,
thus the BVH contained invalid data.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16059
This commit is contained in:
Alex Shvartzkop 2023-11-09 20:52:37 +03:00
parent c95ed281b8
commit 5cd1a4674f
1 changed files with 3 additions and 0 deletions

View File

@ -632,6 +632,9 @@ void EDA_3D_CANVAS::OnMagnify( wxMouseEvent& event )
void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
{
if( m_3d_render && m_3d_render->IsReloadRequestPending() )
return; // Prevents using invalid m_3d_render_raytracing data
if( m_camera_is_moving )
return;