Crashes gdb when default printer is not connected
Original Reporter info from Mantis: sonei
-
Reporter name: sonei
Original Reporter info from Mantis: sonei
- Reporter name: sonei
Description:
If you debug a programa that uses lazreport it crashes the debugger (gdb). If you execute the programa normally it doesn't crash.
Steps to reproduce:
Debug program which uses lazreport when the default printer is disconnected. The crash is in the initiliazation code of LazReport
Additional information:
The point of code that crashes the debugger is in components\lazreport\source\LR_Prntr.pas:
procedure TfrPrinter.SetPrinter(Value: TPrinter);
begin
FPrinters.Clear;
FPrinterIndex := 0;
FPrinter:=Value;
if FPrinter.Printers.Count > 0 then <----- Here
begin
FPrinters.Assign(FPrinter.Printers);
FPrinterIndex := FPrinter.PrinterIndex;
end;
try
GetSettings;
finally
FPrinters.Add(sDefaultPrinter);
FDefaultPrinter := FPrinters.Count - 1;
end;
end;
Mantis conversion info:
- Mantis ID: 17921
- OS: Windows
- OS Build: Windows XP
- Platform: Win32
- Version: 0.9.28.2
- Monitored by: » wimpie (Wimpie Nortje)
- Target version: 0.99.0
- LazTarget: 1.4