Browse Source

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
pull/5/merge
Tomasz Wlostowski 8 years ago
committed by Tomasz Włostowski
parent
commit
b1f613071d
  1. 2
      common/kiway.cpp
  2. 9
      eeschema/sch_edit_frame.cpp
  3. 2
      include/kiway.h

2
common/kiway.cpp

@ -384,7 +384,7 @@ bool KIWAY::PlayersClose( bool doForce )
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 );

9
eeschema/sch_edit_frame.cpp

@ -907,13 +907,12 @@ void SCH_EDIT_FRAME::doUpdatePcb( const wxString& aUpdateOptions )
exporter.Format( &formatter, GNL_ALL );
// Copy the netlist in a static string, to have a long life time
// and giving to Pcbnew the time to analyze this netlist:
static std::string netlist_string;
netlist_string = wxString::Format("%s\n%s", aUpdateOptions, formatter.GetString() ).ToStdString();
auto updateOptions = aUpdateOptions.ToStdString();
auto netlistString = formatter.GetString();
auto finalNetlist = updateOptions + "\n" + netlistString;
// 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 );
}

2
include/kiway.h

@ -344,7 +344,7 @@ public:
* aCommand in there.
*/
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

Loading…
Cancel
Save