[gnome-builder] workbench: add fallbacks to more reliable close
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] workbench: add fallbacks to more reliable close
- Date: Mon, 30 Mar 2015 20:56:45 +0000 (UTC)
commit 3552b8b403673794929ef34840a23ea53fc570fb
Author: Christian Hergert <christian hergert me>
Date: Mon Mar 30 13:53:29 2015 -0700
workbench: add fallbacks to more reliable close
If we get stuck somehow, at least close the damn window.
src/workbench/gb-workbench.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index ad957e3..a75273c 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -98,13 +98,21 @@ gb_workbench_delete_event (GtkWidget *widget,
if (self->unloading)
{
/* Second attempt to kill things, cancel clean shutdown */
- g_cancellable_cancel (self->unload_cancellable);
- return TRUE;
+ if (!g_cancellable_is_cancelled (self->unload_cancellable))
+ {
+ g_cancellable_cancel (self->unload_cancellable);
+ return TRUE;
+ }
+
+ /* third attempt, kill it */
+ return FALSE;
}
+ g_assert_cmpint (self->unloading, ==, FALSE);
+
if (self->context != NULL)
{
- g_assert (!self->unload_cancellable);
+ g_assert (self->unload_cancellable == NULL);
self->unloading = TRUE;
self->unload_cancellable = g_cancellable_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]