Check for valid shared pointer before locking
We don't neccesarily have a valid pointer to the parent lib symbol when
checking if it is a power symbol, so fall back to the local flag if this
is the case
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17182
(cherry picked from commit 4481fcc75e
)
This commit is contained in:
parent
cbef6d1cbf
commit
ac5fab190e
|
@ -653,7 +653,9 @@ const wxString LIB_SYMBOL::GetLibraryName() const
|
|||
|
||||
bool LIB_SYMBOL::IsPower() const
|
||||
{
|
||||
if( LIB_SYMBOL_SPTR parent = m_parent.lock() )
|
||||
std::shared_ptr<LIB_SYMBOL> parent;
|
||||
|
||||
if( !m_parent.expired() && ( parent = m_parent.lock() ) )
|
||||
{
|
||||
if( parent->IsRoot() )
|
||||
return parent->m_options == ENTRY_POWER;
|
||||
|
|
Loading…
Reference in New Issue