eeschema: fix crash when closing simulation frame
Destructor of SIM_PLOT_FRAME calls sim->Attach( nullptr ) in order to destroy circuit model (former netlist exporter). If this is skipped, eeschema crashes when program is closed. nullptr is a valid parameter for Attach()
This commit is contained in:
parent
1594df3498
commit
a9c61d21ca
|
@ -258,10 +258,9 @@ vector<double> NGSPICE::GetPhasePlot( const string& aName, int aMaxLen )
|
|||
bool NGSPICE::Attach( const std::shared_ptr<SIMULATION_MODEL>& aModel )
|
||||
{
|
||||
NGSPICE_CIRCUIT_MODEL* model = dynamic_cast<NGSPICE_CIRCUIT_MODEL*>( aModel.get() );
|
||||
wxASSERT( model != nullptr );
|
||||
STRING_FORMATTER formatter;
|
||||
|
||||
if( model->GetNetlist( &formatter ) )
|
||||
if( model && model->GetNetlist( &formatter ) )
|
||||
{
|
||||
SIMULATOR::Attach( aModel );
|
||||
|
||||
|
|
Loading…
Reference in New Issue