Method Destroy of DRedBlackTree does not Free the
FHeader node.
Using pooled memory, all the memory is freed during
finalization, but the node memory is not actually
released to the pool that cannot reuse it.
Disabling pools and analyzing with a memory leak tool
the problem comes out.
This is my patch in DeCal.pas:
---before---
destructor DRedBlackTree.Destroy;
begin
erase(false);
inherited;
end;
---after
destructor DRedBlackTree.Destroy;
begin
erase(false);
assert(FHeader<>nil);
FHeader.Free;
inherited;
end;
One more thing: the ni_node is allocated but never
freed. This is another patch in DeCal.pas:
---before---
finalization
Cleanup;
end.
---after---
finalization
Cleanup;
if nil_node <> nil then
nil_node.Free;
end.
Tracker: perr@com.dist.unige.it
Logged In: NO
The second of part of this patch, regarding the
finalization, raises an Access Violation, then you should
not apply it.
Logged In: NO
The second of part of this patch, regarding the
finalization, raises an Access Violation, then you should
not apply it.