[eog] EogWindow: Don't unref timer sources before destroying them



commit 5eb839e402f504dc1d22ac6a88fec98283536d21
Author: Felix Riemann <friemann gnome org>
Date:   Sat Apr 6 02:13:00 2019 +0200

    EogWindow: Don't unref timer sources before destroying them
    
    This could cause segfaults if the source was no longer attached
    to the mainloop. Fixes #50.

 src/eog-window.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index c0665563..775eb72e 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -1791,8 +1791,8 @@ fullscreen_clear_timeout (EogWindow *window)
        eog_debug (DEBUG_WINDOW);
 
        if (window->priv->fullscreen_timeout_source != NULL) {
-               g_source_unref (window->priv->fullscreen_timeout_source);
                g_source_destroy (window->priv->fullscreen_timeout_source);
+               g_source_unref (window->priv->fullscreen_timeout_source);
        }
 
        window->priv->fullscreen_timeout_source = NULL;
@@ -1823,8 +1823,8 @@ slideshow_clear_timeout (EogWindow *window)
        eog_debug (DEBUG_WINDOW);
 
        if (window->priv->slideshow_switch_source != NULL) {
-               g_source_unref (window->priv->slideshow_switch_source);
                g_source_destroy (window->priv->slideshow_switch_source);
+               g_source_unref (window->priv->slideshow_switch_source);
        }
 
        window->priv->slideshow_switch_source = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]