Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
6214 00 JVCL Components major always 2013-10-14 11:38 2015-09-14 13:20
PostAp  
obones  
normal  
resolved 3.47  
fixed  
none    
none 3.48  
0006214: TJvSimScope.Destroy memory leak
unit JvSimScope;

destructor TJvSimScope.Destroy;
begin
  FDrawBuffer.Free;
  FLines.Free;
  inherited Destroy;
end;

need be:

destructor TJvSimScope.Destroy;
begin
  FDrawTimer.Free;
  FDrawBuffer.Free;
  FLines.Free;
  inherited Destroy;
end
Issue History
2013-10-14 11:38 PostAp New Issue
2013-10-14 20:48 PostAp Note Added: 0020669
2013-10-15 10:22 Arioch Note Added: 0020670
2013-10-17 23:29 PostAp Note Added: 0020672
2013-10-21 10:58 Arioch Note Added: 0020676
2013-12-13 11:07 obones Status new => acknowledged
2013-12-13 15:54 obones Status acknowledged => resolved
2013-12-13 15:54 obones Fixed in Version => Daily / GIT
2013-12-13 15:54 obones Resolution open => fixed
2013-12-13 15:54 obones Assigned To => obones
2015-09-14 13:20 obones Fixed in Version Daily / GIT => 3.48

Notes
(0020669)
PostAp   
2013-10-14 20:48   
sorry, this better

destructor TJvSimScope.Destroy;
begin
  FDrawTimer.Enabled := False;
  FDrawTimer.OnTimer := nil;
  FDrawBuffer.Free;
  FLines.Free;
  inherited Destroy;
end
(0020670)
Arioch   
2013-10-15 10:22   
So, you would not destroy FDrawTimer at all ?
(0020672)
PostAp   
2013-10-17 23:29   
no, i was wrong in subj name

constructor TJvCustomLED.Create(AOwner: TComponent);
begin
...
  FTimer := TTimer.Create(Self);
...

but if FTimer active when component destroying it can trigg on NIL object in FTimer.OnTimer := DoBlink;
(0020676)
Arioch   
2013-10-21 10:58   
> TTimer.Create(Self);

That means that the component would destroy the timer before destroying itself.
And destroying the timer would do all those things like Enabled := false and OnTimer := nil internally.

So i guess it needs more investigation when and how did you got AV dereference. Perhaps it was done in a different totalyl unrelated place...

PS. OTOH you tell of FTimer in one post and of FDrawTimer in another post, so WHICH timer did you actually referred to?