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
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.