Results 1 to 3 of 3

Thread: Strange Bug with TFileStream on Lazarus MacOS

  1. #1

    Strange Bug with TFileStream on Lazarus MacOS

    Code:
      Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone);
      try
        LoadFromStream(Stream);
      finally
        Stream.Free;
      end;
    I'm getting Access Violations on Stream.Free on Lazarus 0.9.31 and FPC 2.4.2, on MacOS. The same code works on Delphi 2010.

    If I remove Stream.Free it works, but the file remains open.

    Has anyone gone through something similar?

  2. #2
    Code:
    {$IFDEF FPC}
      {$packset 1}
    {$ENDIF}
    This fixed the problem! I don't know why but SizeOf(Set) was returning 4 to me in FPC but 1 in Delphi.

  3. #3
    I'm glad you found the problem

    It might help someone else...

    cheers,
    Paul

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL