Changeset 267 for branches


Ignore:
Timestamp:
Jun 26, 2020, 10:42:40 AM (4 years ago)
Author:
chronos
Message:
  • Fixed: Call inherited in TDpiForm.Destroy destructor.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/DpiControls/UDpiControls.pas

    r266 r267  
    15231523  FreeAndNil(FHorzScrollBar);
    15241524  FreeAndNil(FVertScrollBar);
    1525   inherited Destroy;
     1525  inherited;
    15261526end;
    15271527
     
    16041604procedure TDpiApplication.DoBeforeFinalization;
    16051605var
    1606   i: Integer;
    1607   C: TComponent;
     1606  I: Integer;
    16081607begin
    16091608  if Self = nil then Exit;
    1610   for i := ComponentCount - 1 downto 0 do begin
    1611     if i < ComponentCount then begin
    1612       C := Components[i];
    1613       // C.Name
    1614       C.Free;
    1615     end;
     1609  for I := ComponentCount - 1 downto 0 do begin
     1610    if I < ComponentCount then
     1611      Components[I].Free;
    16161612  end;
    16171613end;
     
    16331629destructor TDpiApplication.Destroy;
    16341630begin
     1631  UnregisterFindGlobalComponentProc(@DpiFindApplicationComponent);
    16351632  ExitProc := FOldExitProc;
    1636   inherited Destroy;
     1633  inherited;
    16371634end;
    16381635
     
    20032000    //TBitmap(GetNativeGraphic).Width, TBitmap(GetNativeGraphic).Height), Bitmap);
    20042001  end else raise Exception.Create('Unsupported class ' + Self.ClassName);
    2005   Bitmap.Free;
     2002  FreeAndNil(Bitmap);
    20062003end;
    20072004
     
    20192016  end else raise Exception.Create('Unsupported class ' + Self.ClassName);
    20202017  Bitmap.SaveToFile(FileName);
    2021   Bitmap.Free;
     2018  FreeAndNil(Bitmap);
    20222019end;
    20232020
     
    20802077    Bitmap.PixelFormat := NativeBitmap.PixelFormat;
    20812078    Bitmap.Canvas.StretchDraw(Bounds(0, 0, NewWidth, NewHeight), NativeBitmap);
    2082     NativeBitmap.Free;
     2079    FreeAndNil(NativeBitmap);
    20832080    NativeBitmap := Bitmap;
    20842081    Canvas.NativeCanvas := NativeBitmap.Canvas;
     
    26712668begin
    26722669  if FNativeFont = AValue then Exit;
    2673   if FNativeFontFree then FNativeFont.Free;
     2670  if FNativeFontFree then FreeAndNil(FNativeFont);
    26742671  FNativeFontFree := False;
    26752672  FNativeFont := AValue;
     
    28092806begin
    28102807  FreeAndNil(Controls);
    2811   inherited Destroy;
     2808  inherited;
    28122809end;
    28132810
     
    31443141  FreeAndNil(FConstraints);
    31453142  FreeAndNil(FFont);
    3146   inherited Destroy;
     3143  inherited;
    31473144end;
    31483145
     
    36043601procedure TDpiForm.CloseHandler(Sender: TObject; var CloseAction: TCloseAction);
    36053602begin
    3606   DoClose(CloseAction);
     3603  Close;
    36073604end;
    36083605
     
    37623759destructor TDpiForm.Destroy;
    37633760begin
    3764   // Name
    37653761  // TODO: Can't destroy directly?
    3766   //FreeAndNil(NativeForm);
    3767 
    37683762  TFormEx(NativeForm).OnMessage := nil;
     3763  FreeAndNil(NativeForm);
     3764
    37693765  DpiScreen.RemoveForm(Self);
     3766  inherited;
    37703767end;
    37713768
Note: See TracChangeset for help on using the changeset viewer.