[gnumeric] SheetControlGUI: Fix crash on closing graph sheet.



commit f5901de5d89cc39ae9d53028ec5ec91294a5042c
Author: Morten Welinder <terra gnome org>
Date:   Sat Nov 15 10:06:02 2014 -0500

    SheetControlGUI: Fix crash on closing graph sheet.

 ChangeLog               |    5 +++++
 NEWS                    |    1 +
 src/sheet-control-gui.c |    5 ++++-
 3 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e177699..7361627 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-15  Morten Welinder  <terra gnome org>
+
+       * src/sheet-control-gui.c (scg_object_unselect): Avoid crashing if
+       the wbc is already gone.
+
 2014-11-09  Morten Welinder  <terra gnome org>
 
        * src/gui-clipboard.c (text_to_cell_region): Guard against NULL
diff --git a/NEWS b/NEWS
index 1b7c6a1..299847b 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ Morten:
        * Pay more attention to union access rules.
        * Attempt a fix for clipboard crash.  [Redhat #1160975]
        * Truncate long strings for display in stf import.
+       * Fix crash on closing a graph sheet.
 
 Thomas Kluyver:
        * Fix import of extended floats from wk4 files.  [#739697]
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 8c54d5f..8982cb7 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -2613,6 +2613,8 @@ cb_scg_object_unselect (SheetObject *so, G_GNUC_UNUSED double *coords, SheetCont
 void
 scg_object_unselect (SheetControlGUI *scg, SheetObject *so)
 {
+       WorkbookControl *wbc = scg_wbc (scg);
+
        /* cheesy cycle avoidance */
        if (scg->selected_objects == NULL)
                return;
@@ -2631,7 +2633,8 @@ scg_object_unselect (SheetControlGUI *scg, SheetObject *so)
        g_hash_table_destroy (scg->selected_objects);
        scg->selected_objects = NULL;
        scg_mode_edit (scg);
-       wb_control_update_action_sensitivity (scg_wbc (scg));
+       if (wbc)
+               wb_control_update_action_sensitivity (wbc);
 }
 
 void


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