-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canvases don't get released while creating a new map instance. #235
Comments
it will get gc'd anyways after a while if it isn't referenced anymore, is something preventing this from happening? it would be good to be able to force it to release immediately, however |
As far I tested, it seems like the garbage collector isn't collecting this. I added a debug string into my game, showing how many canvases are created, and the number increments but no decrease. I added a function to manually destroy the non-referenced canvases and it seems working fine, also the texture memory is not increasing on every new map instance, so... But we need a bug confirmation before. |
Update about this. I also reported this at Love2D forum, and I think we found a solution, no need to create a After testing this, there is no increase of memory. |
I wonder if it would be a good idea to run that inside the init function or
if I should tell users to do it in their own code.
…---
Landon Manning
[email protected]
On Fri, 24 Apr 2020 at 10:11, Juanjo Salvador ***@***.***> wrote:
Update about this. I also reported this at Love2D forum, and I think we
found a solution, no need to create a Canvas:release() function, just
calling collectgarbage() on create new map instace, should work.
After testing this, there is no increase of memory.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#235 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEQD7DKHODOBNRWAWJR5DTROGFW7ANCNFSM4MPTY3TA>
.
|
Maybe keeping this as workaround at this moment is the best choice. |
I noticed that everytime we instance a new map, overwriting the old one, the
Canvas
objects are not released, maybe a LuaJIT related issue, so they are stuck there in memory.Best solution for this would be adding a
:canvasRelease()
function, maybe, so we can force the release of the old stucked objects and free memory.The text was updated successfully, but these errors were encountered: