diff options
author | Ray Strode <rstrode@redhat.com> | 2022-10-14 13:38:03 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2022-10-14 13:38:03 -0400 |
commit | 184d77ef4df561f595db7bc16f54a698f7d87c16 (patch) | |
tree | 198124bcb78479491984c4088e08881125a624ea | |
parent | 92c14f8bea47fab93ebfba417b3b949506f864c8 (diff) | |
download | gnome-calendar-184d77ef4df561f595db7bc16f54a698f7d87c16.tar.gz |
window: Fix crash in toast animationfix-toast-crash
Every once in a while when I'm deleting an event gnome-calendar crashes.
I dug in a bit, and it seems the reason is
adw_toast_overlay_add_toast takes ownership of the passed in reference.
This is a little idiosyncratic for something that's not GInitiallyUnowned,
but it appears to be the API nonetheless.
GCalWindow assumes it owns the reference.
This commit makes both users of the toast happy by adding a ref call.
-rw-r--r-- | src/gui/gcal-window.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/gcal-window.c b/src/gui/gcal-window.c index cb261c4c..a281b38a 100644 --- a/src/gui/gcal-window.c +++ b/src/gui/gcal-window.c @@ -706,7 +706,7 @@ on_event_editor_dialog_remove_event_cb (GcalEventEditorDialog *edit_dialog, g_object_set_data (G_OBJECT (toast), "modifier", GINT_TO_POINTER (modifier)); g_signal_connect (toast, "dismissed", G_CALLBACK (on_toast_dismissed_cb), self); - adw_toast_overlay_add_toast (self->overlay, toast); + adw_toast_overlay_add_toast (self->overlay, g_object_ref (toast)); self->delete_event_toast = g_steal_pointer (&toast); /* hide widget of the event */ |