WinCE: ref result of usbi_get_device_by_session_id()
authorHans de Goede <hdegoede@redhat.com>
Wed, 26 Jun 2013 14:41:22 +0000 (16:41 +0200)
committerHans de Goede <hdegoede@redhat.com>
Wed, 26 Jun 2013 14:41:22 +0000 (16:41 +0200)
commitc1bf7fbab0ed2b5606ff0d50cde2896d0ac2f4ff
tree84495523453702e9a6b93efd52113b2c81de4029
parent43fbe3df02551c4ad9b5976fbd5acc6280e66829
WinCE: ref result of usbi_get_device_by_session_id()

After the "WinCE: Fix device reference leak which caused crash on
libusb_exit()" commit, the code always unref-s dev after adding it to
discovered_devs. But if dev comes from usbi_get_device_by_session_id()
it is a weak ref and as such should not be unreffed.

Instead of re-adding comlicate ref tracking logic, this patch fixes this with
a libusb_device_ref(dev) of dev comes from usbi_get_device_by_session_id(),
turning the weak ref into a strong ref.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
libusb/os/wince_usb.c
libusb/version_nano.h