From: Stefano A. <san...@al...> - 2010-11-17 00:36:14
|
> Eh, was hoping it was something simple. Well, without any > instrumentation, the best I can suggest is start removing the > parts from the inside out. > I.e., take out the transfer first, and test, then take out > the transfer AND the claim, and test, and so on, until all > you have left is init/exit. I've narrowed it down to this at least. Similar rate of private byte increase as the full function. If I remove the open/close calls, there is no change in private bytes. int MainDialog::GetStatusReport( unsigned char *pBuffer ) { libusb_device_handle *handle; int r, bConfigurationValue; int count = -1; int bInterface = 3; int size = 7; int ReportId = 2; // Read from report ID 2 r = libusb_init(NULL); if (r < 0) { goto libusb_init_out; } handle = libusb_open_device_with_vid_pid (NULL, (uint16_t)VID, (uint16_t)PID ); if (handle == NULL) { goto libusb_open_out; } libusb_open_out: libusb_close(handle); libusb_init_out: libusb_exit(NULL); return count; } -Stef |