[gnome-boxes] Fix crash in NotificationBar::cancel() on exit



commit 0534e5395fdaf7e4976153e62cc06a53328ae28d
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Mon Mar 4 14:01:47 2013 +0100

    Fix crash in NotificationBar::cancel() on exit
    
    When exiting Boxes while a notification is shown (I tried
    with the oVirt authentication popup), Boxes segfaults in
    NotificationBar::cancel().
    NotificationBar::cancel() is iterating over the list of active
    notifications and calling gtk_widget_destroy() on them.
    
    GdNotification::destroy() is emitting the GdNotification::discarded
    signal, which NotificationBar catches to remove the current
    notification from the list of active notifications.
    
    After calling gtk_widget_destroy(), NotificationBar::cancel() tries
    to remove the current notification from the active notifications,
    which is useless as this was just done in the callback for
    NotificationBar::dismissed. Even worse, this caused a crash in my
    testing as active_notifications only contained 1 item, so it was empty
    after destroying the widget, and
    active_notifications.remove (active_notifications.data); would attempt
    to dereference a NULL pointer, causing a crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695122

 src/notificationbar.vala |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
---
diff --git a/src/notificationbar.vala b/src/notificationbar.vala
index 9c1ac4f..f05eb8e 100644
--- a/src/notificationbar.vala
+++ b/src/notificationbar.vala
@@ -149,7 +149,6 @@ private class Boxes.Notificationbar: GLib.Object {
         // We destroy all active notifications, which will cause them to be dismissed
         while (active_notifications != null) {
             active_notifications.data.destroy ();
-            active_notifications.remove (active_notifications.data);
         }
     }
 


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