After updating my version of Blitz 3D from 1.87 to 1.93 (I was running behind) I noticed a slowdown in a game I am writing after playing for a minute or so, and not long after that the game would crash. The game was using CreateImage and FreeImage a lot (in fact it was using it too often, that has now been fixed, but I think the memory leak is still there, only smaller so that it would probably still crash the game in the end).
I wrote this test program:
Running this program, which repeatedly creates an image after first deleting an existing image, memory disappears rather quickly. (I am using FreeRam and the ram counter goes down quickly when this program is running.) Running in debug mode, this results in a Memory Access Violation.
Could it be that this is a new problem in version 1.93, or am I doing something wrong here myself?
I am using version 1.93 of IDE, Linker and Runtime, on Windows XP.
Edit 1: the program showing the memory leak can be a bit smaller even, like this:
Edit 2: Switching back to 1.87 makes the memory leak disappear.
I wrote this test program:
Graphics(800,600) SetBuffer(BackBuffer()) Global g_image While(Not(KeyHit(1))) ; delete existing image If (g_image) Then FreeImage(g_image) g_image = 0 End If ; create image g_image = CreateImage(100,20) Wend
Running this program, which repeatedly creates an image after first deleting an existing image, memory disappears rather quickly. (I am using FreeRam and the ram counter goes down quickly when this program is running.) Running in debug mode, this results in a Memory Access Violation.
Could it be that this is a new problem in version 1.93, or am I doing something wrong here myself?
I am using version 1.93 of IDE, Linker and Runtime, on Windows XP.
Edit 1: the program showing the memory leak can be a bit smaller even, like this:
While(Not(KeyHit(1))) image = CreateImage(100,20) FreeImage(image) Wend
Edit 2: Switching back to 1.87 makes the memory leak disappear.