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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-410-g87682d3)



The branch, master has been updated
       via  87682d35b4238c7db9bbc3583a7db8313bb8577f (commit)
       via  4afbecd9128f87980e47221b439d7292395c20bd (commit)
      from  43644681ba1486a5dec10fcfcdad36432ecc071c (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/o_move.c   |    6 +++++-
 gschem/src/x_window.c |   16 ++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)


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

commit 87682d35b4238c7db9bbc3583a7db8313bb8577f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 07:33:15 2008 +0000

    gschem: Fix crash closing window from window-manager during move action
    
    Since the move action uses the place list for drawing, and the objects
    are still on the page, we must be careful to cancel the move action,
    otherwise when the window is closed, we try to double-free the objects
    which are both on the page, and in the place list.

:100644 100644 0ea2014... 47e2e81... M	gschem/src/x_window.c

commit 4afbecd9128f87980e47221b439d7292395c20bd
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 07:31:19 2008 +0000

    gschem: Avoid critical assersion being triggered when cancelling move
    
    We need to set inside_action to 0 before calling o_undo_callback(),
    since that then calls o_redraw_all(). We don't want that redraw to
    think we're still inside an action and attept to draw the (now empty)
    place list. For good measure, place that call after we've cleared out
    the stretch list as well.

:100644 100644 1317b82... 8da5c36... M	gschem/src/o_move.c

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

commit 87682d35b4238c7db9bbc3583a7db8313bb8577f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 07:33:15 2008 +0000

    gschem: Fix crash closing window from window-manager during move action
    
    Since the move action uses the place list for drawing, and the objects
    are still on the page, we must be careful to cancel the move action,
    otherwise when the window is closed, we try to double-free the objects
    which are both on the page, and in the place list.

diff --git a/gschem/src/x_window.c b/gschem/src/x_window.c
index 0ea2014..47e2e81 100644
--- a/gschem/src/x_window.c
+++ b/gschem/src/x_window.c
@@ -596,6 +596,14 @@ void x_window_close(GSCHEM_TOPLEVEL *w_current)
   TOPLEVEL *toplevel = w_current->toplevel;
   gboolean last_window = FALSE;
 
+  /* If we're closing whilst inside a move action, re-wind the
+   * page contents back to their state before we started */
+  if (w_current->inside_action &&
+      (w_current->event_state == MOVE ||
+       w_current->event_state == ENDMOVE)) {
+    o_move_cancel (w_current);
+  }
+
   /* last chance to save possible unsaved pages */
   if (!x_dialog_close_window (w_current)) {
     /* user somehow cancelled the close */
@@ -963,6 +971,14 @@ x_window_close_page (GSCHEM_TOPLEVEL *w_current, PAGE *page)
 
   g_assert (page->pid != -1);
 
+  /* If we're closing whilst inside a move action, re-wind the
+   * page contents back to their state before we started */
+  if (w_current->inside_action &&
+      (w_current->event_state == MOVE ||
+       w_current->event_state == ENDMOVE)) {
+    o_move_cancel (w_current);
+  }
+
   if (page == toplevel->page_current) {
     /* as it will delete current page, select new current page */
     /* first look up in page hierarchy */

commit 4afbecd9128f87980e47221b439d7292395c20bd
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Dec 20 07:31:19 2008 +0000

    gschem: Avoid critical assersion being triggered when cancelling move
    
    We need to set inside_action to 0 before calling o_undo_callback(),
    since that then calls o_redraw_all(). We don't want that redraw to
    think we're still inside an action and attept to draw the (now empty)
    place list. For good measure, place that call after we've cleared out
    the stretch list as well.

diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index 1317b82..8da5c36 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -286,10 +286,14 @@ void o_move_cancel (GSCHEM_TOPLEVEL *w_current)
   }
   g_list_free(w_current->toplevel->page_current->place_list);
   w_current->toplevel->page_current->place_list = NULL;
-  o_undo_callback(w_current, UNDO_ACTION);
 
   s_stretch_destroy_all (toplevel->page_current->stretch_list);
   toplevel->page_current->stretch_list = NULL;
+
+  w_current->inside_action = 0;
+  i_set_state (w_current, SELECT);
+
+  o_undo_callback(w_current, UNDO_ACTION);
 }
 
 




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