[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-373-g3d5fce8)



The branch, master has been updated
       via  3d5fce8f9e6a1172a285dd4a49943f2b05712ca4 (commit)
      from  c24af025cba433db83db48d4b614632b2d5a517c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/src/i_callbacks.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)


=================
 Commit Messages
=================

commit 3d5fce8f9e6a1172a285dd4a49943f2b05712ca4
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 12 16:43:13 2008 +0000

    Avoid crash observed when trying to undo whilst moving.
    
    Move uses the place list, and it leaves the objects in the place list
    on the page. Calling undo free's the page structure, including place
    list objects, AND page objects. Double-free / corruption -> crash.
    
    TODO: Fix move code NOT to use the place list, OR, use more
          intelligence about cancelling from move operations.

:100644 100644 47932ff... 7861989... M	gschem/src/i_callbacks.c

=========
 Changes
=========

commit 3d5fce8f9e6a1172a285dd4a49943f2b05712ca4
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 12 16:43:13 2008 +0000

    Avoid crash observed when trying to undo whilst moving.
    
    Move uses the place list, and it leaves the objects in the place list
    on the page. Calling undo free's the page structure, including place
    list objects, AND page objects. Double-free / corruption -> crash.
    
    TODO: Fix move code NOT to use the place list, OR, use more
          intelligence about cancelling from move operations.

diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 47932ff..7861989 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -412,8 +412,23 @@ DEFINE_I_CALLBACK(edit_undo)
 {
   GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
 
-  w_current->toplevel->DONT_REDRAW = 0;
-  o_undo_callback(w_current, UNDO_ACTION);
+  /* If we're cancelling from a move action, re-wind the
+   * page contents back to their state before we started.
+   *
+   * It "might" be nice to sub-undo rotates / zoom changes
+   * made whilst moving components, but when the undo code
+   * hits s_page_delete(), the place list objects are free'd.
+   * Since they are also contained in the schematic page, a
+   * crash occurs when the page objects are free'd.
+   * */
+  if (w_current->inside_action &&
+      (w_current->event_state == MOVE ||
+       w_current->event_state == ENDMOVE)) {
+    i_callback_cancel (w_current, 0, NULL);
+  } else {
+    w_current->toplevel->DONT_REDRAW = 0;
+    o_undo_callback(w_current, UNDO_ACTION);
+  }
 }
 
 /*! \todo Finish function documentation!!!




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs