Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid clean-up errors confusing people into thinking usb-moded crashed
Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
  • Loading branch information
philippedeswert committed Dec 12, 2012
1 parent 376002c commit 7c8b1d4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/usb_moded-udev.c
Expand Up @@ -159,10 +159,16 @@ static gboolean monitor_udev(GIOChannel *iochannel G_GNUC_UNUSED, GIOCondition c

void hwal_cleanup(void)
{
g_source_remove(watch_id);
watch_id = 0;
g_io_channel_unref(iochannel);
iochannel = NULL;
if(watch_id != 0)
{
g_source_remove(watch_id);
watch_id = 0;
}
if(iochannel != NULL)
{
g_io_channel_unref(iochannel);
iochannel = NULL;
}
udev_monitor_unref(mon);
udev_unref(udev);
}
Expand Down

0 comments on commit 7c8b1d4

Please sign in to comment.