On 2012.11.26 13:28, Toby Gray wrote: > It turns out the reference counting for the default context was slightly > off, introduced by this commit: > https://github.com/libusbx/libusbx/commit/cf6e68acb116c63f4a8c9d30ee4f2757e8c2e12a > > > It moved the setting of usbi_default_context to earlier in the method, > but didn't increment the reference count. > > I've attached a patch to fix the issue.
Looks good to me. With toggleable logging, we need a default context regardless of what we do because of debug that uses it, so we can do away with the second part, and there was indeed a refcount missing in the first one. I'm gonna wait a while (~24 hours) to see if someone has any objections, and if not, I'll push the patch to mainline. And with the patch applied, the stress test does indeed looks much better :) # ./tests/stress Starting test run: init_and_exit... Success (0) Starting test run: get_device_list... Success (0) Starting test run: many_device_lists... Success (0) Starting test run: default_context_change... Success (0) --- Ran 4 tests Passed 4 tests Failed 0 tests Error in 0 tests Skipped 0 tests Regards, /Pete ------------------------------------------------------------------------------ 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