Prevent use-after-free of symbol screens

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17204


(cherry picked from commit 1600d8bead)
This commit is contained in:
Jon Evans 2024-03-05 22:53:51 -05:00
parent 98d26e77c9
commit 31ae825b9d
1 changed files with 1 additions and 0 deletions

View File

@ -1507,6 +1507,7 @@ void SYMBOL_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
{
wxLogTrace( "KICAD_LIB_WATCH", "Refreshing symbol %s", symbol->GetName() );
SetScreen( m_dummyScreen ); // UpdateLibraryBuffer will destroy the old screen
m_libMgr->UpdateLibraryBuffer( libName );
LIB_SYMBOL* lib_symbol = m_libMgr->GetBufferedSymbol( symbol->GetName(), libName );