| 
      
      
      From: Stephan M. <ste...@we...> - 2006-07-31 17:17:43
       | 
| 
I fixed the memory leak in usb_os_determine_children() (file windows.c)
and another one in usb_find_busses() (file usb.c) by including the latest
files from the (linux-) libusb project.
The new files are in the CVS.
I tested the functions with the following code:
int main(void)
{
  usb_init();
  usb_set_debug(255);
  while(1) {
    usb_find_busses();
    usb_find_devices();
  }
}
Everything seems to be ok now.
Stephan
> Hi,
> 
> We've detected a memory leak which seems to have crept into libusb not
> long ago. It looks like it's in usb_os_determine_children which used to
> have an empty body, but now does some mallocs. I can't see where these
> are ever freed, so if you call usb_find_devices more than once you get a
> memory leak. Is this correct?
> 
> I also can't see how buses are successfully freed upon discovery that
> they are no longer there, but this is a very rare occurrence, whereas
> scanning the bus for new devices happens quite often.
> 
> Dan Ellis
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
 | 
| 
      
      
      From: Dan E. <Dan...@ne...> - 2006-08-01 08:06:47
       | 
| Thankyou very much for your swift response.
Dan.
Stephan Meyer wrote:
> I fixed the memory leak in usb_os_determine_children() (file
> windows.c) and another one in usb_find_busses() (file usb.c) by
> including the latest files from the (linux-) libusb project. =20
>=20
> The new files are in the CVS.
>=20
> I tested the functions with the following code:
>=20
> int main(void)
> {
>   usb_init();
>   usb_set_debug(255);
>=20
>   while(1) {
>     usb_find_busses();
>     usb_find_devices();
>   }
> }
>=20
> Everything seems to be ok now.
>=20
> Stephan
>=20
>=20
>> Hi,
>>=20
>> We've detected a memory leak which seems to have crept into libusb
>> not long ago. It looks like it's in usb_os_determine_children which
>> used to have an empty body, but now does some mallocs. I can't see
>> where these are ever freed, so if you call usb_find_devices more
>> than once you get a memory leak. Is this correct?
>>=20
>> I also can't see how buses are successfully freed upon discovery that
>> they are no longer there, but this is a very rare occurrence, whereas
>> scanning the bus for new devices happens quite often.
>>=20
>> Dan Ellis
>>=20
>>
----------------------------------------------------------------------
>> --- Take Surveys. Earn Cash. Influence the Future of IT Join
>> SourceForge.net's Techsay panel and you'll get the chance to share
>> your opinions on IT & business topics through brief surveys -- and
>> earn cash
>>
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEV
>> DEV _______________________________________________
>> Libusb-win32-devel mailing list
>> Lib...@li...
>> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel=20
>=20
>=20
> ______________________________________________________________
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
> Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=3D021193
>=20
>=20
>
------------------------------------------------------------------------
-
> Take Surveys. Earn Cash. Influence the Future of IT Join
> SourceForge.net's Techsay panel and you'll get the chance to share
> your opinions on IT & business topics through brief surveys -- and
> earn cash
>
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDE
V
> _______________________________________________   =20
> Libusb-win32-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
 | 
| 
      
      
      From: Dan E. <Dan...@ne...> - 2006-08-01 12:48:35
       | 
| I think that there may be a handle leak in usb_io_sync, shouldn't the ol.hEvent always be closed regardless of the success of GetOverlappedResult? It is also mildy irksome that the static _usb_busses doesn't get destroyed on application exit, since it triggers memory leak detection tools, but I don't suppose it's a big problem. Dan. |