On 12/11/12 20:09, Pete Batard wrote: > Hi Stefano, > > On 2012.11.12 12:06, Stefano Di Martino wrote: >> is this supposed to crash, when you don't free a list? >> >> for(i = 0; i < 100; i++) { >> cnt = libusb_get_device_list(NULL, &devs); >> if (cnt < 0) >> return (int) cnt; >> //if (i < 99) >> //libusb_free_device_list(devs, 1); >> } > Probably not.
I've been tempted to write a simple test application to do things similar to this for a while now. Just a few for loops which call various APIs many hundreds of times to help detect memory leaks. The only thing which has really stopped me is that I couldn't decide if it should be an example (so live in examples/stress_test.c) or to create a new test directory for test source. > > Now, I am seeing the following issue with your code on Windows when > running git latest, past the 32 mark: > > libusbx: error [set_hid_interface] program assertion failed: max USB > interfaces reached for HID device > > So I guess that, at least with regards to HID on Windows, there is > probably something that needs to be fixed (though the likelihood of > someone making 32 concurrent calls to get_device_list is fairly low, so, > while we definitely want to fix it ASAP, I wouldn't see it as high > priority). > > I'm also having a massive déjà vu with regards to issuing a bunch of > get_device_list() in succession, to try to produce an error. I think we > fixed something there not so long ago, but I can't figure out when that > occurred. Pretty sure it was for libusbx, yet the thread where that > happened eludes me... Are you thinking of this[1] change? [1] - https://github.com/libusbx/libusbx/commit/e82c677b5f10a966c89f6b58caa1ae4341260527 Regards, Toby ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel