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

@ -201,6 +201,9 @@ bool SCH_EDIT_FRAME::ReadyToNetlist( bool aSilent, bool aSilentAnnotate )
void SCH_EDIT_FRAME::sendNetlistToCvpcb()
{
std::string packet;
{
NETLIST_EXPORTER_KICAD exporter( &Schematic() );
STRING_FORMATTER formatter;
@ -208,7 +211,12 @@ void SCH_EDIT_FRAME::sendNetlistToCvpcb()
// @todo : trim GNL_ALL down to minimum for CVPCB
exporter.Format( &formatter, GNL_ALL );
std::string packet = formatter.GetString(); // an abbreviated "kicad" (s-expr) netlist
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
}
Kiway().ExpressMail( FRAME_CVPCB, MAIL_EESCHEMA_NETLIST, packet, this );
}