mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 06:09:29 +02:00
Printers, use finalization handler to free printer avoiding AV, issue #23859
git-svn-id: trunk@43187 -
This commit is contained in:
parent
7ac8ef0af4
commit
ae6aba0c87
@ -1301,7 +1301,15 @@ begin
|
||||
Result := fRightMargin;
|
||||
end;
|
||||
|
||||
finalization
|
||||
If Assigned(Printer) then
|
||||
|
||||
procedure doFreePrinter;
|
||||
begin
|
||||
if Assigned(Printer) then
|
||||
Printer.Free;
|
||||
Printer := nil;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterInterfaceFinalizationHandler(@doFreePrinter);
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user