Changeset 266 for branches/highdpi/Packages/DpiControls/UDpiControls.pas
- Timestamp:
- Jun 26, 2020, 1:13:34 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r265 r266 812 812 FMainForm: TDpiForm; 813 813 FCreatingForm: TDpiForm; 814 FOldExitProc: Pointer; 814 815 function GetActive: Boolean; 815 816 function GetShowMainForm: Boolean; … … 821 822 protected 822 823 function GetNativeApplication: TApplication; virtual; 824 procedure DoBeforeFinalization; 823 825 public 824 826 constructor Create(AOwner: TComponent); override; … … 1594 1596 end; 1595 1597 1598 procedure DpiBeforeFinalization; 1599 // This is our ExitProc handler. 1600 begin 1601 DpiApplication.DoBeforeFinalization; 1602 end; 1603 1604 procedure TDpiApplication.DoBeforeFinalization; 1605 var 1606 i: Integer; 1607 C: TComponent; 1608 begin 1609 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; 1616 end; 1617 end; 1618 1596 1619 function DpiFindApplicationComponent(const ComponentName: string): TComponent; 1597 1620 // Note: this function is used by TReader to auto rename forms to unique names. … … 1603 1626 begin 1604 1627 RegisterFindGlobalComponentProc(@DpiFindApplicationComponent); 1628 FOldExitProc := ExitProc; 1629 ExitProc := @DpiBeforeFinalization; 1605 1630 inherited; 1606 1631 end; … … 1608 1633 destructor TDpiApplication.Destroy; 1609 1634 begin 1635 ExitProc := FOldExitProc; 1610 1636 inherited Destroy; 1611 1637 end; … … 3736 3762 destructor TDpiForm.Destroy; 3737 3763 begin 3764 // Name 3738 3765 // TODO: Can't destroy directly? 3739 3766 //FreeAndNil(NativeForm); 3767 3768 TFormEx(NativeForm).OnMessage := nil; 3740 3769 DpiScreen.RemoveForm(Self); 3741 3770 end;
Note:
See TracChangeset
for help on using the changeset viewer.