Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
5926 Miscellanous major always 2012-06-29 19:24 2015-09-21 17:47
Mark-  
obones  
normal  
resolved  
fixed  
none    
none 3.49  
0005926: TJvHidDeviceController memory leak.
Hello,

I am not sure on the version. It came from JVCL345CompleteJCL231-Build4197

I have a TJvHidDeviceController on a window. When a USB device is plugged in,
TJvHidDevice.Create is called 6 times and TJvHidDevice.Destroy is called 4 times.

All is good.

The window is still open.

When I unplug the device TJvHidDevice.Destroy is not called 2 times causing the memory leak when the program terminates.

I have not been able to locate a call to free the TJvHidDevice objects. They appear to be dangling. They are not in the FList of TJvHidDeviceController.

In TJvHidDeviceController.DeviceChange they are removed from the FList but the objects are not freed. I do not see where they had been or are added to another list.

Thanks for any help.

Ciao,

Mark

cHidControllerClassVersion = '1.0.35';

UnitVersioning: TUnitVersionInfo = (
 RCSfile: '$URL: https://jvcl.svn.sourceforge.net/svnroot/jvcl/tags/JVCL3_45/run/JvHidControllerClass.pas [^] $';
    Revision: '$Revision: 13102 $';
    Date: '$Date: 2011-09-07 07:46:34 +0200 (mer., 07 sept. 2011) $';
    LogPath: 'JVCL\run'
  );
Issue History
2012-06-29 19:24 Mark- New Issue
2012-06-29 19:24 Mark- IDE version => RAD Studio 2007
2012-07-01 15:27 Mark- Note Added: 0020045
2012-07-17 08:48 outchy Project JEDI Code Library => JEDI VCL
2013-01-15 15:20 obones Note Added: 0020345
2013-01-15 15:20 obones Status new => resolved
2013-01-15 15:20 obones Fixed in Version => Daily / SVN
2013-01-15 15:20 obones Resolution open => fixed
2013-01-15 15:20 obones Assigned To => obones
2015-09-21 17:47 obones Fixed in Version Daily / GIT => 3.49

Notes
(0020045)
Mark-   
2012-07-01 15:27   
I made a change and so far all is good.

In JvHidControllerClass, TJvHidDeviceController.DeviceChange;

I changed:

if not HidDev.IsCheckedOut then
 FList.Delete(I);

to:

if not HidDev.IsCheckedOut then
 begin
  FList.Delete(I);
  HidDev.Free;
 end;
(0020345)
obones   
2013-01-15 15:20   
This is now fixed in SVN