-
Notifications
You must be signed in to change notification settings - Fork 482
fix camera filter memory leak #3459
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
base: dev
Are you sure you want to change the base?
Conversation
Co-Authored-By: data5 <99661153+fixeddata@users.noreply.github.com>
extra arg is causing issues... ill figure out a different way soon |
Tried this change on html5 hl and mac native and saw no difference. I see no memory leak on hl or native (mac) with or without this change, regardless of whether there is a sprite drawn. I do see memory climbing in html5 to a GC call but I also see that in a blank project (I should make an issue for that). For what targets were you seeing a memory leak? also, what purpose does the |
i know for sure the leak happens on cpp windows; i didnt see it happen on hl windows or html5 and as for the |
I'll try on windows
I'm leaning towards removing it entirely, we don't really need to optimize, when nothing is being drawn |
currently the game rapidly leaks memory if 5 conditions are met:
renderTile
bgColor
alpha is0
BitmapFilter
applied to this cameraunsure of exactly what the lower-level issue is causing this bug, but my guess is that after the
canvas.graphics
is cleared inCameraFrontEnd.lock
, due to the above conditions its never drawn to again before the next frame, and so the filters are put in a weird state and somehow memory is leakedthis pr fixes the issue by adding a
force
option toFlxCamera.fill
to bypass the alpha early-return forrenderTile
, and forcing abgColor
fill for it if any filters are currently active on the camera regardless of the alpha valueto reproduce the issue:
before and after fix: