From 5d73a280bea2d7bd166696b6ebd0b4b50b3028df Mon Sep 17 00:00:00 2001 From: Christopher Aillon Date: Thu, 8 Sep 2005 19:30:10 +0000 Subject: [PATCH] leak fix: unref fullscreen_timeout_source before clearing it 2005-09-08 Christopher Aillon * shell/ev-window.c: (fullscreen_timeout_cb), (fullscreen_set_timeout), (fullscreen_clear_timeout), (ev_window_dispose): leak fix: unref fullscreen_timeout_source before clearing it --- ChangeLog | 8 ++++++++ shell/ev-window.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e306804..20b79c9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-09-08 Christopher Aillon + + * shell/ev-window.c: (fullscreen_timeout_cb), + (fullscreen_set_timeout), (fullscreen_clear_timeout), + (ev_window_dispose): + + leak fix: unref fullscreen_timeout_source before clearing it + 2005-09-08 Nickolay V. Shmyrev * configure.ac, dvi/mdvi/Makefile.am: diff --git a/shell/ev-window.c b/shell/ev-window.c index 9bd1eac9..0b4f919e 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -1681,6 +1681,7 @@ fullscreen_timeout_cb (gpointer data) g_object_set (window->priv->fullscreen_popup, "visible", FALSE, NULL); ev_view_hide_cursor (EV_VIEW (window->priv->view)); + g_source_unref (window->priv->fullscreen_timeout_source); window->priv->fullscreen_timeout_source = NULL; return FALSE; @@ -1691,8 +1692,10 @@ fullscreen_set_timeout (EvWindow *window) { GSource *source; - if (window->priv->fullscreen_timeout_source != NULL) + if (window->priv->fullscreen_timeout_source != NULL) { + g_source_unref (window->priv->fullscreen_timeout_source); g_source_destroy (window->priv->fullscreen_timeout_source); + } source = g_timeout_source_new (1000); g_source_set_callback (source, fullscreen_timeout_cb, window, NULL); @@ -1703,8 +1706,10 @@ fullscreen_set_timeout (EvWindow *window) static void fullscreen_clear_timeout (EvWindow *window) { - if (window->priv->fullscreen_timeout_source != NULL) + if (window->priv->fullscreen_timeout_source != NULL) { + g_source_unref (window->priv->fullscreen_timeout_source); g_source_destroy (window->priv->fullscreen_timeout_source); + } window->priv->fullscreen_timeout_source = NULL; ev_view_show_cursor (EV_VIEW (window->priv->view)); @@ -2777,6 +2782,7 @@ ev_window_dispose (GObject *object) } if (window->priv->fullscreen_timeout_source) { + g_source_unref (window->priv->fullscreen_timeout_source); g_source_destroy (window->priv->fullscreen_timeout_source); window->priv->fullscreen_timeout_source = NULL; } -- 2.43.5