Force remove tree watcher when setting

The lib watch on Mac may not actually remove the tree on DTOR, so we
need to force the removal.  This also adds some additional debug flags
if the issue continues

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15173
This commit is contained in:
Seth Hillbrand 2023-07-12 14:27:41 -07:00
parent cfa0d4bfb7
commit dde017cdc2
1 changed files with 6 additions and 0 deletions

View File

@ -1148,10 +1148,14 @@ void PCB_BASE_FRAME::SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions, boo
void PCB_BASE_FRAME::setFPWatcher( FOOTPRINT* aFootprint )
{
wxLogTrace( "KICAD_LIB_WATCH", "setFPWatcher" );
Unbind( wxEVT_FSWATCHER, &PCB_BASE_FRAME::OnFPChange, this );
if( !aFootprint )
{
wxLogTrace( "KICAD_LIB_WATCH", "Remove watch" );
m_watcher->RemoveAll();
m_watcher.reset();
return;
}
@ -1198,6 +1202,8 @@ void PCB_BASE_FRAME::setFPWatcher( FOOTPRINT* aFootprint )
fn.AssignDir( m_watcherFileName.GetPath() );
fn.DontFollowLink();
wxLogTrace( "KICAD_LIB_WATCH", "Add watch: %s", fn.GetPath() );
m_watcher->AddTree( fn );
}