MichaelSinsbeck / platformer

A ninja platformer written in LÖVE
7 stars 0 forks source link

Switching to fullscreen becomes slower each time #151

Open michalove opened 10 years ago

michalove commented 10 years ago

To reproduce: Start the game. In the main menu press f multiple times (wait for each switch to finish). On my computer after the third time, this took so long, I had to kill the process. Can you reproduce this?

michalove commented 10 years ago

I did some tests on this and have narrowed down the source of the problem a bit. The first time, I toggle fullscreen, it takes about 4 seconds. The second time takes about 66 seconds.

It turned out the line that causes the slow down, is "love.graphics.setMode". When I put "garbageCollect()" right at the start of this line, then the slowdown does not happen.

Don't know, if I can consider this issue as closed, of if we need to investigate further. It might be the case, that we have some sort of memory leak...

michalove commented 10 years ago

Okay, I decided to put a "garbageCollect()" after the fullscreen toggle. I believe, all the images, that were stored before, were not deleted automatically.