diff options
author | Corey Berla <corey@berla.me> | 2022-07-25 08:54:12 -0700 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2022-08-01 07:13:02 +0000 |
commit | 27137a1c46c22ff17635f9f59fa06596ce90e503 (patch) | |
tree | 74d09ec6ee4c242cd1e722623e36477f15d70a90 | |
parent | 4237e4291700168a5801b3f1910512facf78f34e (diff) | |
download | nautilus-27137a1c46c22ff17635f9f59fa06596ce90e503.tar.gz |
trash-monitor: Fix crash when launching nautilus after shutdown starts
eel-debug-shutdown unrefs the trash-monitor but doesn't set it to
NULL. The nautilus_trash_monitor_get () function only creates a
new trash_monitor when the static variable nautilus_trash_monitor
is set to null. Simply set nautilus_trash_montior to NULL after
unreffing.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2064
-rw-r--r-- | src/nautilus-trash-monitor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nautilus-trash-monitor.c b/src/nautilus-trash-monitor.c index 2e2beaa65..366116f59 100644 --- a/src/nautilus-trash-monitor.c +++ b/src/nautilus-trash-monitor.c @@ -215,9 +215,9 @@ nautilus_trash_monitor_init (NautilusTrashMonitor *trash_monitor) } static void -unref_trash_monitor (void) +clear_trash_monitor_on_shutdown (void) { - g_object_unref (nautilus_trash_monitor); + g_clear_object (&nautilus_trash_monitor); } NautilusTrashMonitor * @@ -229,7 +229,7 @@ nautilus_trash_monitor_get (void) nautilus_trash_monitor = NAUTILUS_TRASH_MONITOR (g_object_new (NAUTILUS_TYPE_TRASH_MONITOR, NULL)); - eel_debug_call_at_shutdown (unref_trash_monitor); + eel_debug_call_at_shutdown (clear_trash_monitor_on_shutdown); } return nautilus_trash_monitor; |