libftdi Archives

Subject: RE: libftdi-1.0: Reduce memory leaks

From: "Michael Plante" <michael.plante@xxxxxxxxx>
To: <libftdi@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 7 Jun 2010 12:18:25 -0500
Uwe Bonnes wrote:
>> libusb_init() requires libusb_exit() to free all memory. I placed this
call
>> in ftdi_free(). libusb_get_device_list() also requires a
>> libusb_free_device_list(). This free must happen after an libusb_open()
and
>> in all the error pathes, so I added a define for the error case and the
return of
>> the libusb_open() call must be remembered.
>>
>>      ftdi_deinit(ftdi);
>> +    libusb_exit(NULL);
>>      free(ftdi);


I admit I haven't been looking at libftdi-1.0 much yet, but does libftdi-1
not yet support non-default libusb contexts (i.e., libusb_context * !=
NULL)?  That will be a stumbling point before I can upgrade from 0.1...

Regards,
Michael


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread