[gnome-boxes/toast-revolution: 6/9] toast: Make sure we don't hold references to the callbacks




commit 639b429e35429c7d0800d2d2cdda0777ff42d250
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Jan 20 19:54:21 2022 +0100

    toast: Make sure we don't hold references to the callbacks
    
    Otherwise a dismiss () might run after an undo (). A Toast should
    execute only one of the callbacks.

 src/ui/toast.vala | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/ui/toast.vala b/src/ui/toast.vala
index 5730392a..e5029631 100644
--- a/src/ui/toast.vala
+++ b/src/ui/toast.vala
@@ -51,4 +51,11 @@ private void on_undo_button_clicked () {
 
         destroy ();
     }
+
+    public override void destroy () {
+        dismiss_func = null;
+        undo_func = null;
+
+        base.destroy ();
+    }
 }


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