2136:procedure PrepareColors;
2137:begin
2138: if ColorsHolder = nil then begin
2139: ColorsHolder := TacColorsHolder.Create;
2140: ColorsHolder.acPrettyNames := TStringList.Create; // <= This is not needed, see constructor TacColorsHolder.Create;
2141: GetColorValues(ColorsHolder.acColorCallBack);
2142: end;
2143:end;
Code:
3211:finalization
3212: {$IFDEF DELPHI6UP}
3213: if ColorsHolder = nil then // <= This should be if Assigned(ColorsHolder) then
3214: ColorsHolder.Free;
There is no reason to free an object if it is already nil (that would be an AV). That causes a part of that memory leak. Another part comes from the string list that is created twice.
Code:
if ColorsHolder nil then
ColorsHolder.Free;
Would make sense but ColorsHolder = nil does not… I rather use Assigned and not Assigned than nil and = nil…