在一个小程序中,我要从一份INI中载入一些数据,显示在窗口上,如下。procedure TFrmMain.LoadINI;
var
  fini:TINIFile
  sl:TStrings;
  i:Integer;
begin
  //
  fini:=TIniFile.Create(ExtractFilePath(Application.ExeName)+'MYPro.INI');  //载入打印机列表
  sl:=TStrings.Create;
  sl:=Printer.Printers;
  cbCKPrinter.Items.Clear;
  cbFPPrinter.Items.Clear;
  for I := 0 to sl.Count - 1 do
    begin
      cb1.Items.Add(sl[i]);
      cb2.Items.Add(sl[i]);
    end;
  sl.Free;    //设定默认打印机
  cb1.ItemIndex:=fini.ReadInteger('PRINTERSELECT','CKINDEX',0);
  cb2.ItemIndex:=fini.ReadInteger('PRINTERSELECT','FPINDEX',0);  //
  edt1.Text:=fini.ReadString('NO','FPNO','0');
  fini.Free;
end;
我把此段代码放在 Form 的 Create 处,结果在关闭窗口时出现错误。
invalid pointer operation按说 sl 我也释放了,fini我也释放了,为什么还出现无效指针操作?
窗口的 Close 事件没写任何东西。