Devices can outlive their context in some cases (in particular with
python garbage collection). Guard against this by clearing the ctx
pointer so that it is not pointing to uninitialized memory.
Closes #1058
[Cherrypick from mainline commit c3639bc ("core: Unset device ctx if it has been destroyed")]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ic1a27aea2b29d07c93d96d98a684facc799b4259
for_each_device(_ctx, dev) {
usbi_warn(_ctx, "device %d.%d still referenced",
dev->bus_number, dev->device_address);
+ DEVICE_CTX(dev) = NULL;
}
if (!list_empty(&_ctx->open_devs))
-#define LIBUSB_NANO 11692
+#define LIBUSB_NANO 11693