-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
getContextSafariWebGL2Fixed create memory leak ? #17409
Comments
If you don't need to support Safari then you can set Separately, as Safari fixed the issue over a year ago, probably it was released in the latest version, so we could use a version check to skip this automatically when possible. |
I just find out that this function can be disabled with flag: GL_WORKAROUND_SAFARI_GETCONTEXT_BUG |
When running emcc with flag
-s MODULARIZE=1 -s environment=web
, it will generate a commonJS module.Inside the module function, it stores the wasmMemory and other staff, and it replaces the original
canvas.getContext
with getContextSafariWebGL2FixedUsually this is not a problem, however, I want to "reload" the module, in order to GC the whole wasmMemory buffer.
For example:
However, I found out that as long as this function is kept by the canvas element, and the canvas element is kept by the DOM tree, or by some JavaScript (e.g. FiberNode on React), the memory will be kept alive indirectly
Possible solution I found:
Or is there a flag so that this function will not be generated because I don't need to support Safari
The text was updated successfully, but these errors were encountered: