eeschema: workaround for 64kByte string length limit in wxString::Format() causing segfaults in netlist update under Windows

Fixes: lp:1754402
* https://bugs.launchpad.net/kicad/+bug/1754402
This commit is contained in:
Tomasz Wlostowski 2018-03-12 14:27:45 +01:00 committed by Tomasz Włostowski
parent ab37801489
commit b1f613071d
3 changed files with 6 additions and 7 deletions

View File

@ -384,7 +384,7 @@ bool KIWAY::PlayersClose( bool doForce )
void KIWAY::ExpressMail( FRAME_T aDestination, void KIWAY::ExpressMail( FRAME_T aDestination,
MAIL_T aCommand, const std::string& aPayload, wxWindow* aSource ) MAIL_T aCommand, std::string aPayload, wxWindow* aSource )
{ {
KIWAY_EXPRESS mail( aDestination, aCommand, aPayload, aSource ); KIWAY_EXPRESS mail( aDestination, aCommand, aPayload, aSource );

View File

@ -907,13 +907,12 @@ void SCH_EDIT_FRAME::doUpdatePcb( const wxString& aUpdateOptions )
exporter.Format( &formatter, GNL_ALL ); exporter.Format( &formatter, GNL_ALL );
// Copy the netlist in a static string, to have a long life time auto updateOptions = aUpdateOptions.ToStdString();
// and giving to Pcbnew the time to analyze this netlist: auto netlistString = formatter.GetString();
static std::string netlist_string; auto finalNetlist = updateOptions + "\n" + netlistString;
netlist_string = wxString::Format("%s\n%s", aUpdateOptions, formatter.GetString() ).ToStdString();
// Now, send the "kicad" (s-expr) netlist to Pcbnew // Now, send the "kicad" (s-expr) netlist to Pcbnew
Kiway().ExpressMail( FRAME_PCB, MAIL_SCH_PCB_UPDATE, netlist_string, this ); Kiway().ExpressMail( FRAME_PCB, MAIL_SCH_PCB_UPDATE, finalNetlist, this );
} }

View File

@ -344,7 +344,7 @@ public:
* aCommand in there. * aCommand in there.
*/ */
VTBL_ENTRY void ExpressMail( FRAME_T aDestination, MAIL_T aCommand, VTBL_ENTRY void ExpressMail( FRAME_T aDestination, MAIL_T aCommand,
const std::string& aPayload, wxWindow* aSource = NULL ); std::string aPayload, wxWindow* aSource = NULL );
/** /**
* Function Prj * Function Prj