[Solved] AV error at function TsAlphaImageList.GetCount

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #71322
    SzakiLaci
    Participant

      Tip2:

      I had always memory release problems while destroying forms with VirtualImageList on it.
      Found a solution:
      Calling this proc when form is getting destroyed solves it:

      procedure VirtPicList_FREE(var v : TsVirtualImageList);
      begin
          if v = nil then Exit;
          try
              v.ShareImages := False;
              v.UseCache    := False; // this also calls ClearImages 
              v.Clear;
          except end;
          v := nil;
      end;

      Called simply by:

      procedure TFrm_money.FormDestroy(Sender: TObject);
      begin
        VirtPicList_FREE( MyVirtList );
        ... 
        inherited;
      end;
    Viewing 1 post (of 1 total)
    • You must be logged in to reply to this topic.