← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Autosave assertion failure workaround

 

Oops, the same thing has to be applied in pcbnew. Patch attached.

On Thu, Jun 18, 2015 at 02:43:56PM -0400, Wayne Stambaugh wrote:
> Patch committed in product branch r5782.  Thanks.
> 
> On 6/16/2015 11:40 AM, Chris Pavlina wrote:
> > When eeschema attempts to autosave a schematic that hasn't been saved 
> > before, an assertion (common/basicframe.cpp:656) fails. Here's a patch 
> > that works around that.
> > 
> > I call this a workaround rather than a fix because I'd rather autosave 
> > still work for things that don't have a filename yet, but that has to be 
> > done more carefully. It would require a check at startup for a backup 
> > file saved to a predetermined location (ideally somewhere within either 
> > /tmp or ~/.kicad on Linux, and the equivalent locations on other 
> > systems).
> > 
> > --
> > Chris
> > 
> > 
> > 
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> > 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
commit 9f36d7a5da4c6dbc1ce9f2b2d65387a7e9e06699
Author: Chris Pavlina <cpavlin1@xxxxxxxxxxxxxx>
Date:   Tue Jun 16 16:22:48 2015 -0400

    Fix autosave bug in pcbnew too

diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp
index 68e0085..b9c7dbb 100644
--- a/pcbnew/files.cpp
+++ b/pcbnew/files.cpp
@@ -813,7 +813,9 @@ bool PCB_EDIT_FRAME::doAutoSave()
     wxLogTrace( traceAutoSave,
                 wxT( "Creating auto save file <" + fn.GetFullPath() ) + wxT( ">" ) );
 
-    if( SavePcbFile( fn.GetFullPath(), NO_BACKUP_FILE ) )
+    if( !fn.IsOk() )
+        return false;
+    else if( SavePcbFile( fn.GetFullPath(), NO_BACKUP_FILE ) )
     {
         GetScreen()->SetModify();
         GetBoard()->SetFileName( tmpFileName.GetFullPath() );

Follow ups

References