aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-03-25 22:53:54 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-03-25 23:11:44 +0800
commitc8be2c5fe1a1dc943bc293bb269da116a7f237ad (patch)
treebff0a04b478998f65308826b4b7d81c8896166d5
parente438bd526df3ee719c8f7080edfd8f242965ba3d (diff)
downloadgsoc2013-evolution-c8be2c5fe1a1dc943bc293bb269da116a7f237ad.tar.gz
gsoc2013-evolution-c8be2c5fe1a1dc943bc293bb269da116a7f237ad.tar.zst
gsoc2013-evolution-c8be2c5fe1a1dc943bc293bb269da116a7f237ad.zip
Fix an EShell reference leak.
GApplication calls g_main_loop_quit() immediately when the last window is destroyed, whereas we do it from an idle callback with an extra ref on EShell to keep it alive until the idle callback runs. But because GApplication beats us to the punch, our idle callback never runs and the EShell reference leaks. For now, we'll just disable the quit_mainloop() method of GApplication. If GtkApplication grows a signal equivalent to EShell::window-destroyed, EShell could drop its window_destroyed() method and let G[tk]Application handle things normally.
-rw-r--r--shell/e-shell.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c
index d9dcb5de9a..d7ecf69d8c 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -834,6 +834,14 @@ shell_open (GApplication *application,
}
static void
+shell_quit_mainloop (GApplication *application)
+{
+ /* XXX Don't allow GApplication to quit the main loop.
+ * We'll do that ourselves until GtkApplication gets
+ * a signal equivalent to EShell::window-destroyed. */
+}
+
+static void
shell_window_destroyed (EShell *shell)
{
if (e_shell_get_watched_windows (shell) == NULL)
@@ -871,6 +879,7 @@ e_shell_class_init (EShellClass *class)
application_class->startup = shell_startup;
application_class->activate = shell_activate;
application_class->open = shell_open;
+ application_class->quit_mainloop = shell_quit_mainloop;
class->window_destroyed = shell_window_destroyed;