- Timestamp:
- Jun 26, 2020, 10:42:40 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r266 r267 1523 1523 FreeAndNil(FHorzScrollBar); 1524 1524 FreeAndNil(FVertScrollBar); 1525 inherited Destroy;1525 inherited; 1526 1526 end; 1527 1527 … … 1604 1604 procedure TDpiApplication.DoBeforeFinalization; 1605 1605 var 1606 i: Integer; 1607 C: TComponent; 1606 I: Integer; 1608 1607 begin 1609 1608 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; 1616 1612 end; 1617 1613 end; … … 1633 1629 destructor TDpiApplication.Destroy; 1634 1630 begin 1631 UnregisterFindGlobalComponentProc(@DpiFindApplicationComponent); 1635 1632 ExitProc := FOldExitProc; 1636 inherited Destroy;1633 inherited; 1637 1634 end; 1638 1635 … … 2003 2000 //TBitmap(GetNativeGraphic).Width, TBitmap(GetNativeGraphic).Height), Bitmap); 2004 2001 end else raise Exception.Create('Unsupported class ' + Self.ClassName); 2005 Bitmap.Free;2002 FreeAndNil(Bitmap); 2006 2003 end; 2007 2004 … … 2019 2016 end else raise Exception.Create('Unsupported class ' + Self.ClassName); 2020 2017 Bitmap.SaveToFile(FileName); 2021 Bitmap.Free;2018 FreeAndNil(Bitmap); 2022 2019 end; 2023 2020 … … 2080 2077 Bitmap.PixelFormat := NativeBitmap.PixelFormat; 2081 2078 Bitmap.Canvas.StretchDraw(Bounds(0, 0, NewWidth, NewHeight), NativeBitmap); 2082 NativeBitmap.Free;2079 FreeAndNil(NativeBitmap); 2083 2080 NativeBitmap := Bitmap; 2084 2081 Canvas.NativeCanvas := NativeBitmap.Canvas; … … 2671 2668 begin 2672 2669 if FNativeFont = AValue then Exit; 2673 if FNativeFontFree then F NativeFont.Free;2670 if FNativeFontFree then FreeAndNil(FNativeFont); 2674 2671 FNativeFontFree := False; 2675 2672 FNativeFont := AValue; … … 2809 2806 begin 2810 2807 FreeAndNil(Controls); 2811 inherited Destroy;2808 inherited; 2812 2809 end; 2813 2810 … … 3144 3141 FreeAndNil(FConstraints); 3145 3142 FreeAndNil(FFont); 3146 inherited Destroy;3143 inherited; 3147 3144 end; 3148 3145 … … 3604 3601 procedure TDpiForm.CloseHandler(Sender: TObject; var CloseAction: TCloseAction); 3605 3602 begin 3606 DoClose(CloseAction);3603 Close; 3607 3604 end; 3608 3605 … … 3762 3759 destructor TDpiForm.Destroy; 3763 3760 begin 3764 // Name3765 3761 // TODO: Can't destroy directly? 3766 //FreeAndNil(NativeForm);3767 3768 3762 TFormEx(NativeForm).OnMessage := nil; 3763 FreeAndNil(NativeForm); 3764 3769 3765 DpiScreen.RemoveForm(Self); 3766 inherited; 3770 3767 end; 3771 3768
Note:
See TracChangeset
for help on using the changeset viewer.