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:
parent
3ac454153e
commit
f45883ac3d
|
@ -1157,9 +1157,11 @@ void PCB_BASE_FRAME::setFPWatcher( FOOTPRINT* aFootprint )
|
||||||
wxLogTrace( "KICAD_LIB_WATCH", "Remove watch" );
|
wxLogTrace( "KICAD_LIB_WATCH", "Remove watch" );
|
||||||
|
|
||||||
if( m_watcher )
|
if( m_watcher )
|
||||||
|
{
|
||||||
m_watcher->RemoveAll();
|
m_watcher->RemoveAll();
|
||||||
|
m_watcher->SetOwner( nullptr );
|
||||||
m_watcher.reset();
|
m_watcher.reset();
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue