Shrink lifetime of variable

In 7.0, this avoids a warning. In this branch, someone implemented the
compiler's suggestion, but there is an easier way.
This commit is contained in:
Simon Richter 2023-03-10 23:07:38 +01:00 committed by Ian McInerney
parent f1db501adb
commit 08e6458abc
1 changed files with 2 additions and 4 deletions

View File

@ -921,12 +921,10 @@ int KICAD_MANAGER_CONTROL::ShowPluginManager( const TOOL_EVENT& aEvent )
KIWAY& kiway = m_frame->Kiway();
// Reset state containing global lib tables
KIFACE* kiface;
if( ( kiface = kiway.KiFACE( KIWAY::FACE_SCH, false ) ) )
if( KIFACE* kiface = kiway.KiFACE( KIWAY::FACE_SCH, false ) )
kiface->Reset();
if( ( kiface = kiway.KiFACE( KIWAY::FACE_PCB, false ) ) )
if( KIFACE* kiface = kiway.KiFACE( KIWAY::FACE_PCB, false ) )
kiface->Reset();
// Reload lib tables