AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2011.05.05 16:44 "[Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Katerina Sedivy
2011.05.05 15:03 "[Tiff] Access Violation on TiffClose()", by Katerina Sedivy
2011.05.05 15:27 "Re: [Tiff] Access Violation on TiffClose()", by Olivier Paquet
2011.05.05 16:02 "Re: [Tiff] Access Violation on TiffClose()", by Katerina Sedivy
2011.05.05 16:22 "Re: [Tiff] Access Violation on TiffClose()", by Olivier Paquet
2011.05.05 17:42 "Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Frank Warmerdam
2011.05.05 19:01 "Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Bob Friesenhahn
2011.05.05 19:49 "Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Katerina Sedivy
2011.05.05 20:16 "Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Bob Friesenhahn
2011.05.06 17:07 "Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Katerina Sedivy
2011.05.12 06:09 "Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Andreas Kleinert
2011.05.05 19:59 "Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Katerina Sedivy
2011.05.05 21:08 "Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?", by Frank Warmerdam

2011.05.05 16:02 "Re: [Tiff] Access Violation on TiffClose()", by Katerina Sedivy

Ok I was checking the return of TiffOpen at debug mode with a watch, but I still ran the test here is something weird:

This does NOT work: Access violation

var
  l_Tiff: pointer;
begin

  l_Tiff := DLL_TIFFOpen(PChar('C:\Develop\Tests\Service
app\Thread3\cheque_216_A.tif'), 'r');
  try

  finally
    if l_Tiff <> nil then
      DLL_TIFFClose(l_Tiff);

  end;
end;

This WORKS and still executes TIFFClose:

var
  l_Tiff: pointer;
begin

  l_Tiff := DLL_TIFFOpen(PChar('C:\Develop\Tests\Service
app\Thread3\cheque_216_A.tif'), 'r');
  if l_Tiff <> nil then
  begin
      DLL_TIFFClose(l_Tiff);
      outputdebugstring(PChar('pass'));
  end;
end;

On Thu, May 5, 2011 at 11:27 AM, Olivier Paquet <olivier.paquet@gmail.com>wrote:

On Thu, May 5, 2011 at 11:03 AM, Katerina Sedivy <sedivyk@gmail.com> wrote:

procedure TMainAppRunnerDlg.btnTIFFOpenClick(Sender: TObject);
var

lh_TiffHandle: Pointer;

begin

> >   lh_TiffHandle := DLL_TIFFOpen('C:\Develop\Tests\cheque_216_A.tif',

> 'r');

> try
> finally
> DLL_TIFFClose(lh_TiffHandle);
> end;
> end;

It looks to me like you don't actually check that TIFFOpen works. TIFFClose will definitely crash on a null handle so that might be your problem.