team: fix a crash on team devices (rh #1013593)

teamd was being watched using g_bus_watch_name(). But when the NM team device
was destroyed NM tried to remove the watcher with g_source_remove() instead of
g_bus_unwatch_name(). Thus the watcher was not removed and
teamd_dbus_appeared() was called on disposed device.

https://bugzilla.redhat.com/show_bug.cgi?id=1013593#c28

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Jiří Klimeš 2013-10-02 18:48:19 +02:00 committed by Thomas Haller
parent e4fc7440cc
commit 23e90ee76d

View file

@ -241,7 +241,7 @@ teamd_cleanup (NMDevice *dev)
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (dev);
if (priv->teamd_dbus_watch) {
g_source_remove (priv->teamd_dbus_watch);
g_bus_unwatch_name (priv->teamd_dbus_watch);
priv->teamd_dbus_watch = 0;
}