Clear owner of old watcher before resetting std::unique_ptr.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15173
This commit is contained in:
parent
054252ccbe
commit
cbf685ad76
|
@ -627,17 +627,18 @@ void SCH_BASE_FRAME::setSymWatcher( const LIB_ID* aID )
|
||||||
{
|
{
|
||||||
Unbind( wxEVT_FSWATCHER, &SCH_BASE_FRAME::OnSymChange, this );
|
Unbind( wxEVT_FSWATCHER, &SCH_BASE_FRAME::OnSymChange, this );
|
||||||
|
|
||||||
if( !aID )
|
if( m_watcher )
|
||||||
{
|
{
|
||||||
wxLogTrace( "KICAD_LIB_WATCH", "No symbol library specified, disabling watcher" );
|
wxLogTrace( "KICAD_LIB_WATCH", "Remove watch" );
|
||||||
|
m_watcher->RemoveAll();
|
||||||
|
m_watcher->SetOwner( nullptr );
|
||||||
m_watcher.reset();
|
m_watcher.reset();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString libfullname;
|
wxString libfullname;
|
||||||
SYMBOL_LIB_TABLE* tbl = Prj().SchSymbolLibTable();
|
SYMBOL_LIB_TABLE* tbl = Prj().SchSymbolLibTable();
|
||||||
|
|
||||||
if( !tbl )
|
if( !id || !tbl )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -1152,18 +1152,12 @@ void PCB_BASE_FRAME::setFPWatcher( FOOTPRINT* aFootprint )
|
||||||
|
|
||||||
Unbind( wxEVT_FSWATCHER, &PCB_BASE_FRAME::OnFPChange, this );
|
Unbind( wxEVT_FSWATCHER, &PCB_BASE_FRAME::OnFPChange, this );
|
||||||
|
|
||||||
if( !aFootprint )
|
if( m_watcher )
|
||||||
{
|
{
|
||||||
wxLogTrace( "KICAD_LIB_WATCH", "Remove watch" );
|
wxLogTrace( "KICAD_LIB_WATCH", "Remove watch" );
|
||||||
|
m_watcher->RemoveAll();
|
||||||
if( m_watcher )
|
m_watcher->SetOwner( nullptr );
|
||||||
{
|
m_watcher.reset();
|
||||||
m_watcher->RemoveAll();
|
|
||||||
m_watcher->SetOwner( nullptr );
|
|
||||||
m_watcher.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString libfullname;
|
wxString libfullname;
|
||||||
|
|
Loading…
Reference in New Issue