gtkplacesview: disconnect from server list monitor changes on destroy
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 19 Apr 2018 07:47:30 +0000 (02:47 -0500)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 19 Apr 2018 07:59:52 +0000 (02:59 -0500)
It might happen otherwise that a change is recorded in between the
widget dispose and finalization, causing a crash when setting
the visible name for the GtkStack (as that will be NULL at that point)

gtk/gtkplacesview.c

index d1ce605eb1c35b35a59fa5981df04c2189248fe6..abbf5dd3df9ae2e62238da0edca885ed96154641 100644 (file)
@@ -392,6 +392,9 @@ gtk_places_view_destroy (GtkWidget *widget)
   if (priv->network_monitor)
     g_signal_handlers_disconnect_by_func (priv->network_monitor, update_places, widget);
 
+  if (priv->server_list_monitor)
+    g_signal_handlers_disconnect_by_func (priv->server_list_monitor, server_file_changed_cb, widget);
+
   g_cancellable_cancel (priv->cancellable);
   g_cancellable_cancel (priv->networks_fetching_cancellable);