Fix race condition between eeschema and cvpcb.

Fixes https://gitlab.com/kicad/code/kicad/issues/6969
This commit is contained in:
Jeff Young 2021-01-18 17:04:52 +00:00
parent 44655b98de
commit 1eb6902b82
1 changed files with 13 additions and 5 deletions

View File

@ -202,13 +202,21 @@ bool SCH_EDIT_FRAME::ReadyToNetlist( bool aSilent, bool aSilentAnnotate )
void SCH_EDIT_FRAME::sendNetlistToCvpcb()
{
NETLIST_EXPORTER_KICAD exporter( &Schematic() );
STRING_FORMATTER formatter;
std::string packet;
// @todo : trim GNL_ALL down to minimum for CVPCB
exporter.Format( &formatter, GNL_ALL );
{
NETLIST_EXPORTER_KICAD exporter( &Schematic() );
STRING_FORMATTER formatter;
// @todo : trim GNL_ALL down to minimum for CVPCB
exporter.Format( &formatter, GNL_ALL );
packet = formatter.GetString(); // an abbreviated "kicad" (s-expr) netlist
// NETLIST_EXPORTER_KICAD must go out of scope so it can clean up things like the
// current sheet setting before sending expressmail
}
std::string packet = formatter.GetString(); // an abbreviated "kicad" (s-expr) netlist
Kiway().ExpressMail( FRAME_CVPCB, MAIL_EESCHEMA_NETLIST, packet, this );
}