[glom] Avoid a crash at shutdown.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Avoid a crash at shutdown.
- Date: Wed, 11 Sep 2013 10:24:50 +0000 (UTC)
commit 9d7e0d610f6a46944511b7b3e873ea20598ea050
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Sep 11 10:24:45 2013 +0200
Avoid a crash at shutdown.
* glom/bakery/appwindow_withdoc.cc: on_menu_file_close():
Close the document after hiding the UI, instead of the other way
around because, with Gio::Application, hiding the window can cause
it to be deleted, making any further use of it impossible.
ChangeLog | 9 +++++++++
glom/bakery/appwindow_withdoc.cc | 8 ++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 76cf7a0..805e80d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-08-19 Murray Cumming <murrayc murrayc com>
+
+ Avoid a crash at shutdown.
+
+ * glom/bakery/appwindow_withdoc.cc: on_menu_file_close():
+ Close the document after hiding the UI, instead of the other way
+ around because, with Gio::Application, hiding the window can cause
+ it to be deleted, making any further use of it impossible.
+
2013-07-19 Murray Cumming <murrayc murrayc com>
Avoid deprecated Gtk::Stock* API.
diff --git a/glom/bakery/appwindow_withdoc.cc b/glom/bakery/appwindow_withdoc.cc
index 1cb82a6..21136cd 100644
--- a/glom/bakery/appwindow_withdoc.cc
+++ b/glom/bakery/appwindow_withdoc.cc
@@ -58,10 +58,14 @@ void AppWindow_WithDoc::on_menu_file_close()
offer_to_save_changes(); //If a File|Exit is in progress, this could cancel it.
}
+ on_document_close();
+
if(!get_operation_cancelled())
+ {
+ //Note that this can result in this appwindow being deleted,
+ //so we do it last.
ui_hide();
-
- on_document_close();
+ }
}
bool AppWindow_WithDoc::open_document_from_data(const guchar* data, std::size_t length)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]