placesview: fix testsuite

Because the network monitor can perfectly be NULL,
the tests were failing on that for GtkPlacesView
always tries to disconnect this handler.

Fix that by only disconnecting the handler when
the network monitor exists.

https://bugzilla.gnome.org/show_bug.cgi?id=781195
This commit is contained in:
Georges Basile Stavracas Neto 2017-04-11 16:46:14 -03:00
parent 9b5a92f5cc
commit 42aa4c138c

View File

@ -398,7 +398,9 @@ gtk_places_view_destroy (GtkWidget *widget)
priv->destroyed = 1;
g_signal_handlers_disconnect_by_func (priv->volume_monitor, update_places, widget);
g_signal_handlers_disconnect_by_func (priv->network_monitor, update_places, widget);
if (priv->network_monitor)
g_signal_handlers_disconnect_by_func (priv->network_monitor, update_places, widget);
g_cancellable_cancel (priv->cancellable);
g_cancellable_cancel (priv->networks_fetching_cancellable);