[Done] Memory leak using TIF-images with CCITT G4 compression (fax)

Post bugreports for the Windows version here
fabulouspaul
User
User
Posts: 34
Joined: Sun Nov 23, 2014 1:18 pm

[Done] Memory leak using TIF-images with CCITT G4 compression (fax)

Post by fabulouspaul »

It seems there is a bug when it comes to deal with black & white TIF-images compressed with CCITT G4 compression method.
When loading such an image and releasing the image again, there is still memory left that is not released and it is increasing the more often such images are loaded and released.

The code to show is quite simple:

Code: Select all

EnableExplicit
UseTIFFImageDecoder()

Enumeration
  #img_handle
EndEnumeration

Global i
Global filename.s

filename = OpenFileRequester("Select TIF...", "", "TIF-Image (*.tif)|*.tif", 0) 

If filename <> ""
  MessageRequester("TIF memory leak PB " + Str(#PB_Compiler_Version), "Check memory usage of " + GetFilePart(ProgramFilename()) + " in Windows Taskmanager")
  
  For i = 1 To 1000
    If LoadImage(#img_handle, filename) = 0
       Debug Str(i) + ": Image " + filename + " not loaded"
    Else   
       FreeImage(#img_handle)
    EndIf    
  Next
  
  MessageRequester("TIF memory leak PB " + Str(#PB_Compiler_Version), "Check memory usage of " + GetFilePart(ProgramFilename()) + " in Windows Taskmanager")
EndIf

End
To prevent errors on my side in measuring memory usage, i check the amount of memory used by the program with the Windows Taskmanager.

A hint in the german forum made me check older versions of PB and i found that in PB 4.60 (x86) this error doesnt occur. Starting from PB 4.61 to current version the described memory leak can be found.

I put together the code above, a TIF in CCITT G4 compression and 2 compiled EXE files (PB4.60 and PB5.42) here: Download

As TIF-images in CCITT G4 compression are great for storing b&w images, it would be nice if this bug could be fixed.
Fred
Administrator
Administrator
Posts: 16617
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] Memory leak using TIF-images with CCITT G4 compression (fax)

Post by Fred »

Fixed.
Post Reply