diff options
author | Felix Riemann <friemann@gnome.org> | 2022-11-17 22:56:08 +0100 |
---|---|---|
committer | Felix Riemann <friemann@gnome.org> | 2023-01-07 15:27:51 +0100 |
commit | 18cbb07ee5284f236aba6b2f71f6f7e4e576dacb (patch) | |
tree | 6f5ec200b137f669256388fa7eec0a281afd9c79 | |
parent | 6dd99e8afe888e1a0100b83b7bb75f646edd16da (diff) | |
download | eog-18cbb07ee5284f236aba6b2f71f6f7e4e576dacb.tar.gz |
EogWindow: Avoid critical warning when saving images on exit
The general save callback and the specific callback for saving images on
exit both clear the window's save job. The second callback triggering
will then cause a critical warning. Instead of manually clearing the
job, use `g_clear_object` which avoids that warning.
Fixes #263.
-rw-r--r-- | src/eog-window.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/eog-window.c b/src/eog-window.c index 68035254..0627ffcc 100644 --- a/src/eog-window.c +++ b/src/eog-window.c @@ -2335,8 +2335,7 @@ eog_job_close_save_cb (EogJobSave *job, gpointer user_data) window); /* clean the last save job */ - g_object_unref (window->priv->save_job); - window->priv->save_job = NULL; + g_clear_object (&window->priv->save_job); /* recover save action from actions group */ action_save = g_action_map_lookup_action (G_ACTION_MAP (window), @@ -2778,8 +2777,7 @@ eog_job_save_cb (EogJobSave *job, gpointer user_data) window); /* clean the last save job */ - g_object_unref (window->priv->save_job); - window->priv->save_job = NULL; + g_clear_object (&window->priv->save_job); /* recover save action from actions group */ action_save = g_action_map_lookup_action (G_ACTION_MAP (window), |