Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 0c8139a..c634a07 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -2745,14 +2745,23 @@ zoom_control_changed_cb (EphyZoomAction *action,
static void
ev_window_finalize (GObject *object)
{
- GList *windows = gtk_window_list_toplevels ();
+ gboolean empty = TRUE;
+ GList *list, *windows;
- if (windows == NULL) {
- ev_application_shutdown (EV_APP);
- } else {
- g_list_free (windows);
- }
+ windows = gtk_window_list_toplevels ();
+
+ for (list = windows; list; list = list->next) {
+ if (EV_IS_WINDOW (list->data)) {
+ empty = FALSE;
+ break;
+ }
+ }
+
+ if (empty)
+ ev_application_shutdown (EV_APP);
+
+ g_list_free (windows);
G_OBJECT_CLASS (ev_window_parent_class)->finalize (object);
}