From: Peter S. <pe...@st...> - 2009-09-27 01:16:00
|
Philip A. Prindeville wrote: > By the way, libusb_exit() should probably be idempotent. It's not. > If you call it twice, it segfaults. You're not supposed to call it twice. > Didn't look into it, but I suspect it doesn't zero pointers that > it's done with... If you pass in a bad pointer, libusb can't know that it's the same pointer that was already freed. The caller has to keep track of that, just like with almost every other library. (And it's technically not possible for libusb to zero the pointer that is passed in. It would need to be a pointer to a pointer for that to work.) //Peter |