Ngspice: Preload a basically empty circuit to avoid error messages
Fixes https://gitlab.com/kicad/code/kicad/issues/12481
This commit is contained in:
parent
9eb3854794
commit
6e874f4c1e
|
@ -579,6 +579,19 @@ void NGSPICE::init_dll()
|
|||
Command( "set noaskquit" );
|
||||
Command( "set nomoremode" );
|
||||
|
||||
// reset and remcirc give an error if no circuit is loaded, so load an empty circuit at the
|
||||
// start.
|
||||
|
||||
vector<char*> lines;
|
||||
lines.push_back( strdup( "*" ) );
|
||||
lines.push_back( strdup( ".end" ) );
|
||||
lines.push_back( nullptr ); // Sentinel.
|
||||
|
||||
m_ngSpice_Circ( lines.data() );
|
||||
|
||||
for( auto line : lines )
|
||||
free( line );
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue