Don't try to unref a NULL GIOChannel

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3456 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-03-14 18:51:00 +00:00
parent 013251281f
commit 96d96766fb

View file

@ -304,10 +304,13 @@ nm_serial_device_close (NMSerialDevice *device)
if (priv->fd) {
nm_debug ("Closing device '%s'", nm_device_get_iface (NM_DEVICE (device)));
g_io_channel_unref (priv->channel);
if (priv->channel) {
g_io_channel_unref (priv->channel);
priv->channel = NULL;
}
ioctl (priv->fd, TCSETA, &priv->old_t);
close (priv->fd);
priv->fd = 0;
}
}