jodleren
2010-12-16 16:31:41 UTC
Hi all!
In a form, I use a custom component, which uses 2 TImages and 2 arrays
of boolean.
On a form, I have a TCollection, where I create a number of these
components.
But, when destroying the form, I get an access violation, after
destroying 9 of 28 components, when setting the array of boolean to 0
- the FWinner.
Next, when I try to open the window again I get yet another access
violation, and I cannot recover from that.
It has to be some kind of memory leak, right? Any ideas what to look
for?
destructor TLottoBox.Destroy;
begin
try
FImg.Destroy;
FImg2.Destroy;
SetLength(FChecked, 0);
SetLength(FWinner, 0); // access violation here.
except
end;
inherited;
end;
In a form, I use a custom component, which uses 2 TImages and 2 arrays
of boolean.
On a form, I have a TCollection, where I create a number of these
components.
But, when destroying the form, I get an access violation, after
destroying 9 of 28 components, when setting the array of boolean to 0
- the FWinner.
Next, when I try to open the window again I get yet another access
violation, and I cannot recover from that.
It has to be some kind of memory leak, right? Any ideas what to look
for?
destructor TLottoBox.Destroy;
begin
try
FImg.Destroy;
FImg2.Destroy;
SetLength(FChecked, 0);
SetLength(FWinner, 0); // access violation here.
except
end;
inherited;
end;