Ensure watcher is valid

Call ordering appears to allow invalid m_watcher settings for MacOS, so
we need to check if m_watcher has been initialized before clearing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15173
This commit is contained in:
Seth Hillbrand 2023-07-14 09:08:36 -07:00
parent 3ac454153e
commit f45883ac3d
1 changed files with 4 additions and 2 deletions

View File

@ -1157,9 +1157,11 @@ void PCB_BASE_FRAME::setFPWatcher( FOOTPRINT* aFootprint )
wxLogTrace( "KICAD_LIB_WATCH", "Remove watch" );
if( m_watcher )
{
m_watcher->RemoveAll();
m_watcher.reset();
m_watcher->SetOwner( nullptr );
m_watcher.reset();
}
return;
}