Fix severe simulation memory leaks
This commit is contained in:
parent
9b15717349
commit
3e8532264e
|
@ -680,4 +680,10 @@ void NGSPICE::validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NGSPICE::Clean()
|
||||||
|
{
|
||||||
|
Command( "destroy all" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool NGSPICE::m_initialized = false;
|
bool NGSPICE::m_initialized = false;
|
||||||
|
|
|
@ -93,6 +93,9 @@ public:
|
||||||
///< @copydoc SPICE_SIMULATOR::GetNetlist()
|
///< @copydoc SPICE_SIMULATOR::GetNetlist()
|
||||||
virtual const std::string GetNetlist() const override;
|
virtual const std::string GetNetlist() const override;
|
||||||
|
|
||||||
|
///< @copydoc SIMULATOR::Clean()
|
||||||
|
void Clean() override final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
|
|
|
@ -480,6 +480,7 @@ void SIM_PLOT_FRAME::StartSimulation( const wxString& aSimCommand )
|
||||||
m_simulator->LoadNetlist( formatter.GetString() );
|
m_simulator->LoadNetlist( formatter.GetString() );
|
||||||
updateTuners();
|
updateTuners();
|
||||||
applyTuners();
|
applyTuners();
|
||||||
|
m_simulator->Clean();
|
||||||
m_simulator->Run();
|
m_simulator->Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1649,6 +1650,8 @@ void SIM_PLOT_FRAME::doCloseWindow()
|
||||||
if( m_simulator->IsRunning() )
|
if( m_simulator->IsRunning() )
|
||||||
m_simulator->Stop();
|
m_simulator->Stop();
|
||||||
|
|
||||||
|
m_simulator->Clean();
|
||||||
|
|
||||||
// Cancel a running simProbe or simTune tool
|
// Cancel a running simProbe or simTune tool
|
||||||
m_schematicFrame->GetToolManager()->RunAction( ACTIONS::cancelInteractive );
|
m_schematicFrame->GetToolManager()->RunAction( ACTIONS::cancelInteractive );
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,11 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual bool IsRunning() = 0;
|
virtual bool IsRunning() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear simulation data (i.e. all vectors).
|
||||||
|
*/
|
||||||
|
virtual void Clean() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a Spice command as if it was typed into console.
|
* Execute a Spice command as if it was typed into console.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue