[gnome-boxes/gnome-3-22] app-window: Disconnect from machine callbacks at removal



commit 804eb42bebb32dfd2f8cc106a49c6928cff08f79
Author: Visarion Alexandru <viorel visarion gmail com>
Date:   Mon Jul 4 11:39:47 2016 +0300

    app-window: Disconnect from machine callbacks at removal
    
    The problem is that after removing a window, its deleted machine
    is still able to send signals to it and consequentially to try
    to remove it again during the actual machine deletion process,
    which leads to undefined behaviour.
    
    Let's simply disconnect the machine's callbacks in its window
    when the machine is signaled as deleted.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767214

 src/app-window.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index 6b5eff0..7622fec 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -435,6 +435,11 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
 
             machine.window = null;
             machine.schedule_autosave ();
+
+            machine.disconnect (machine_state_notify_id);
+            machine_state_notify_id = 0;
+            machine.disconnect (machine_deleted_notify_id);
+            machine_deleted_notify_id = 0;
         }
 
         return App.app.remove_window (this);


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