mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 12:44:00 +02:00
TAChart: Use FreeAndNil instead of Free for object fields
git-svn-id: trunk@24592 -
This commit is contained in:
parent
4a39ffeb78
commit
ef7d9b0948
@ -252,7 +252,7 @@ end;
|
||||
|
||||
destructor TChartAxisTitle.Destroy;
|
||||
begin
|
||||
FFont.Free;
|
||||
FreeAndNil(FFont);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
@ -291,8 +291,8 @@ end;
|
||||
|
||||
destructor TChartAxisMarks.Destroy;
|
||||
begin
|
||||
FListener.Free;
|
||||
FDefaultSource.Free;
|
||||
FreeAndNil(FListener);
|
||||
FreeAndNil(FDefaultSource);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
@ -349,10 +349,10 @@ end;
|
||||
|
||||
destructor TChartAxis.Destroy;
|
||||
begin
|
||||
FTitle.Free;
|
||||
FMarks.Free;
|
||||
FListener.Free;
|
||||
FGrid.Free;
|
||||
FreeAndNil(FTitle);
|
||||
FreeAndNil(FMarks);
|
||||
FreeAndNil(FListener);
|
||||
FreeAndNil(FGrid);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
@ -725,7 +725,7 @@ initialization
|
||||
SkipObsoleteAxisProperties;
|
||||
|
||||
finalization
|
||||
VIdentityTransform.Free;
|
||||
FreeAndNil(VIdentityTransform);
|
||||
|
||||
end.
|
||||
|
||||
|
@ -790,7 +790,7 @@ var
|
||||
begin
|
||||
for i := 0 to Count - 1 do
|
||||
TListener(Items[i]).Forget;
|
||||
inherited Destroy;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TBroadcaster.Subscribe(AListener: TListener);
|
||||
|
@ -363,11 +363,10 @@ end;
|
||||
|
||||
destructor TChartSeries.Destroy;
|
||||
begin
|
||||
FListener.Free;
|
||||
FBuiltinSource.Free;
|
||||
FMarks.Free;
|
||||
|
||||
inherited Destroy;
|
||||
FreeAndNil(FListener);
|
||||
FreeAndNil(FBuiltinSource);
|
||||
FreeAndNil(FMarks);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TChartSeries.Extent: TDoubleRect;
|
||||
|
@ -65,6 +65,9 @@ procedure Register;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
SysUtils;
|
||||
|
||||
type
|
||||
|
||||
{ TDbChartSourceDataLink }
|
||||
@ -140,8 +143,8 @@ end;
|
||||
|
||||
destructor TDbChartSource.Destroy;
|
||||
begin
|
||||
FDataLink.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FDataLink);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TDbChartSource.GetCount: Integer;
|
||||
|
@ -406,19 +406,19 @@ end;
|
||||
|
||||
destructor TChart.Destroy;
|
||||
begin
|
||||
FSeries.Free;
|
||||
FGraphBrush.Free;
|
||||
FreeAndNil(FSeries);
|
||||
FreeAndNil(FGraphBrush);
|
||||
|
||||
FLegend.Free;
|
||||
FTitle.Free;
|
||||
FFoot.Free;
|
||||
FAxisList.Free;
|
||||
FFrame.Free;
|
||||
FExtent.Free;
|
||||
FMargins.Free;
|
||||
FBuiltinToolset.Free;
|
||||
FreeAndNil(FLegend);
|
||||
FreeAndNil(FTitle);
|
||||
FreeAndNil(FFoot);
|
||||
FreeAndNil(FAxisList);
|
||||
FreeAndNil(FFrame);
|
||||
FreeAndNil(FExtent);
|
||||
FreeAndNil(FMargins);
|
||||
FreeAndNil(FBuiltinToolset);
|
||||
|
||||
inherited Destroy;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
{$IFDEF LCLGtk2}
|
||||
@ -1095,7 +1095,7 @@ destructor TBasicChartSeries.Destroy;
|
||||
begin
|
||||
if FChart <> nil then
|
||||
FChart.DeleteSeries(Self);
|
||||
inherited Destroy;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TBasicChartSeries.GetNearestPoint(
|
||||
@ -1152,8 +1152,8 @@ end;
|
||||
destructor TChartSeriesList.Destroy;
|
||||
begin
|
||||
Clear;
|
||||
FList.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FList);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TChartSeriesList.GetItem(AIndex: Integer): TBasicChartSeries;
|
||||
@ -1201,6 +1201,6 @@ initialization
|
||||
SeriesClassRegistry := TStringList.Create;
|
||||
|
||||
finalization
|
||||
SeriesClassRegistry.Free;
|
||||
FreeAndNil(SeriesClassRegistry);
|
||||
|
||||
end.
|
||||
|
@ -207,9 +207,9 @@ end;
|
||||
|
||||
destructor TChartLegend.Destroy;
|
||||
begin
|
||||
FBackgroundBrush.Free;
|
||||
FFont.Free;
|
||||
FFrame.Free;
|
||||
FreeAndNil(FBackgroundBrush);
|
||||
FreeAndNil(FFont);
|
||||
FreeAndNil(FFrame);
|
||||
|
||||
inherited;
|
||||
end;
|
||||
|
@ -325,7 +325,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
GraphMath, Math, PropEdits, Types;
|
||||
GraphMath, Math, PropEdits, SysUtils, Types;
|
||||
|
||||
{ TLineSeries }
|
||||
|
||||
@ -353,9 +353,9 @@ end;
|
||||
|
||||
destructor TLineSeries.Destroy;
|
||||
begin
|
||||
FLinePen.Free;
|
||||
FPointer.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FLinePen);
|
||||
FreeAndNil(FPointer);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TLineSeries.Draw(ACanvas: TCanvas);
|
||||
@ -480,8 +480,8 @@ end;
|
||||
|
||||
destructor TLine.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
FPen.Free;
|
||||
FreeAndNil(FPen);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TLine.Draw(ACanvas: TCanvas);
|
||||
@ -701,9 +701,9 @@ end;
|
||||
|
||||
destructor TBarSeries.Destroy;
|
||||
begin
|
||||
FBarPen.Free;
|
||||
FBarBrush.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FBarPen);
|
||||
FreeAndNil(FBarBrush);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TBarSeries.Draw(ACanvas: TCanvas);
|
||||
@ -951,9 +951,9 @@ end;
|
||||
|
||||
destructor TAreaSeries.Destroy;
|
||||
begin
|
||||
FAreaLinesPen.Free;
|
||||
FAreaBrush.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FAreaLinesPen);
|
||||
FreeAndNil(FAreaBrush);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TAreaSeries.Draw(ACanvas: TCanvas);
|
||||
@ -1079,10 +1079,10 @@ end;
|
||||
|
||||
destructor TFuncSeries.Destroy;
|
||||
begin
|
||||
FExtent.Free;
|
||||
FDomainExclusions.Free;
|
||||
FPen.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FExtent);
|
||||
FreeAndNil(FDomainExclusions);
|
||||
FreeAndNil(FPen);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TFuncSeries.Draw(ACanvas: TCanvas);
|
||||
|
@ -268,7 +268,7 @@ end;
|
||||
|
||||
destructor TCustomChartSource.Destroy;
|
||||
begin
|
||||
FBroadcaster.Free;
|
||||
FreeAndNil(FBroadcaster);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
@ -527,9 +527,9 @@ end;
|
||||
destructor TListChartSource.Destroy;
|
||||
begin
|
||||
Clear;
|
||||
FDataPoints.Free;
|
||||
FData.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FDataPoints);
|
||||
FreeAndNil(FData);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TListChartSource.GetCount: Integer;
|
||||
@ -677,8 +677,8 @@ end;
|
||||
|
||||
destructor TRandomChartSource.Destroy;
|
||||
begin
|
||||
FRNG.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FRNG);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TRandomChartSource.GetCount: Integer;
|
||||
|
@ -168,7 +168,7 @@ resourcestring
|
||||
implementation
|
||||
|
||||
uses
|
||||
ComponentEditors, Forms, GraphMath, Math, PropEdits, Types,
|
||||
ComponentEditors, Forms, GraphMath, Math, PropEdits, SysUtils, Types,
|
||||
TAChartUtils, TASubcomponentsEditor;
|
||||
|
||||
type
|
||||
@ -457,8 +457,8 @@ destructor TChartToolset.Destroy;
|
||||
begin
|
||||
while Tools.Count > 0 do
|
||||
Item[Tools.Count - 1].Free;
|
||||
FTools.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FTools);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TChartToolset.Dispatch(
|
||||
@ -689,7 +689,7 @@ initialization
|
||||
|
||||
finalization
|
||||
|
||||
ToolsClassRegistry.Free;
|
||||
FreeAndNil(ToolsClassRegistry);
|
||||
|
||||
end.
|
||||
|
||||
|
@ -378,8 +378,8 @@ destructor TChartAxisTransformations.Destroy;
|
||||
begin
|
||||
while List.Count > 0 do
|
||||
TAxisTransform(List[List.Count - 1]).Free;
|
||||
FList.Free;
|
||||
FBroadcaster.Free;
|
||||
FreeAndNil(FList);
|
||||
FreeAndNil(FBroadcaster);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
@ -513,7 +513,7 @@ initialization
|
||||
|
||||
finalization
|
||||
|
||||
AxisTransformsClassRegistry.Free;
|
||||
FreeAndNil(AxisTransformsClassRegistry);
|
||||
|
||||
end.
|
||||
|
||||
|
@ -357,10 +357,10 @@ end;
|
||||
|
||||
destructor TChartTitle.Destroy;
|
||||
begin
|
||||
FBrush.Free;
|
||||
FFont.Free;
|
||||
FFrame.Free;
|
||||
FText.Free;
|
||||
FreeAndNil(FBrush);
|
||||
FreeAndNil(FFont);
|
||||
FreeAndNil(FFrame);
|
||||
FreeAndNil(FText);
|
||||
|
||||
inherited;
|
||||
end;
|
||||
@ -427,11 +427,11 @@ end;
|
||||
|
||||
destructor TGenericChartMarks.Destroy;
|
||||
begin
|
||||
FFrame.Free;
|
||||
FLabelBrush.Free;
|
||||
FLabelFont.Free;
|
||||
FLinkPen.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FFrame);
|
||||
FreeAndNil(FLabelBrush);
|
||||
FreeAndNil(FLabelFont);
|
||||
FreeAndNil(FLinkPen);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TGenericChartMarks.DrawLabel(
|
||||
@ -580,9 +580,9 @@ end;
|
||||
|
||||
destructor TSeriesPointer.Destroy;
|
||||
begin
|
||||
FBrush.Free;
|
||||
FPen.Free;
|
||||
inherited Destroy;
|
||||
FreeAndNil(FBrush);
|
||||
FreeAndNil(FPen);
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TSeriesPointer.Draw(ACanvas: TCanvas; ACenter: TPoint; AColor: TColor);
|
||||
|
Loading…
Reference in New Issue
Block a user