core: Fixup default_context handling
authorHans de Goede <hdegoede@redhat.com>
Thu, 16 May 2013 14:43:24 +0000 (16:43 +0200)
committerHans de Goede <hdegoede@redhat.com>
Thu, 16 May 2013 15:18:32 +0000 (17:18 +0200)
commit4ea8e4a1b99e6ff5578dd2c7e0d2f7bbfd1631b3
tree18a3801e5a54168742d73fb684fd69ee2b8cfe60
parentfc8be23868ef1161278e978568ff630f27132cb3
core: Fixup default_context handling

Now that we set the default context earlier in libusb_init:
-There is no need to do it a second time at the end of libusb_init
-We need to set it to NULL if libusb_init fails later on
-Since it now can be set then reset by libusb_init, libusb_exit needs to
 take the lock while testing if the passed in ctx == default_context

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