[gnome-control-center/gnome-42] network: prevent crash by disconnecting device



commit 8e6b89dbbd3b45c3f194d8357934d8807ae3b48e
Author: Amy <apark0006 student cerritos edu>
Date:   Thu Jun 16 06:36:08 2022 +0000

    network: prevent crash by disconnecting device
    
    When a device is registered with add_wifi_device, a corresponding signal
    is registered for events. The associated remove_wifi_device clears the
    associated pages, but does not disconnect the signal. This causes the
    assertion NET_IS_DEVICE_WIFI to fail.
    
    This patch corrects this error, resolving #1889 as per the suggested fix
    from Benjamin (@bberg).

 panels/network/cc-wifi-panel.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/panels/network/cc-wifi-panel.c b/panels/network/cc-wifi-panel.c
index b2d93746f..e53bae7f0 100644
--- a/panels/network/cc-wifi-panel.c
+++ b/panels/network/cc-wifi-panel.c
@@ -424,6 +424,11 @@ remove_wifi_device (CcWifiPanel *self,
         }
     }
 
+  /* Disconnect the signal to prevent assertion crash */
+  g_signal_handlers_disconnect_by_func (device, 
+                                        G_CALLBACK (wifi_panel_update_qr_image_cb), 
+                                        self);
+
   /* Destroy all stack pages related to this device */
   child = gtk_stack_get_child_by_name (self->stack, id);
   gtk_stack_remove (self->stack, child);


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