sharing: Prevent an endless loop and resulting stack overflow

We need to block ourselves around the gtk_switch_set_active() call in
the error path, when we can't speak to the sharing dbus service, or we
end up in an endless loop since we're the ::state-set handler.

https://bugzilla.gnome.org/show_bug.cgi?id=739886
This commit is contained in:
Rui Matos 2014-11-10 15:06:52 +01:00
parent a91a607a56
commit 7121f03564

View file

@ -190,7 +190,11 @@ cc_sharing_networks_enable_network (GtkSwitch *widget,
g_warning ("Failed to %s service %s: %s", state ? "enable" : "disable",
self->priv->service_name, error->message);
g_error_free (error);
g_signal_handlers_block_by_func (widget,
cc_sharing_networks_enable_network, self);
gtk_switch_set_active (widget, !state);
g_signal_handlers_unblock_by_func (widget,
cc_sharing_networks_enable_network, self);
}
cc_sharing_update_networks (self);