← Back to team overview

kicad-developers team mailing list archive

[PATCH] Autosave assertion failure workaround

 

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
commit f56c975823f66fa690ca44a35a2dd96f0dc6d831
Author: Chris Pavlina <cpavlin1@xxxxxxxxxxxxxx>
Date:   Tue Jun 16 11:36:51 2015 -0400

    Workaround for autosave assertion failure

diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp
index 4ef6572..39922f5 100644
--- a/eeschema/files-io.cpp
+++ b/eeschema/files-io.cpp
@@ -509,6 +509,9 @@ bool SCH_EDIT_FRAME::doAutoSave()
 
     tmp.AssignDir( fn.GetPath() );
 
+    if( !tmp.IsOk() )
+        return false;
+
     if( !IsWritable( tmp ) )
         return false;
 

Follow ups