react-postprocessing
react-postprocessing copied to clipboard
Memory Leak | Bloom
As described in #68 there's a memory leak when updating the intensity of Bloom
Here's our reproduction:
https://codesandbox.io/s/mystifying-kare-k4lh3b?file=/src/App.js
useFrame(() => {
if (bloomRef.current && intensityRef.current) {
bloomRef.current.intensity = intensityRef.current;
}
});
Screencast: (Activity Monitor > View > Update Frequency > Very Often (1sec)
maybe related discussion/cause here
Was there ever a solution created for this issue? I am running into the same issue within my project.
Was there ever a solution created for this issue? I am running into the same issue within my project.
Not to my knowledge. If you use postprocessing directly it's avoidable though.
What do you mean by "directly"?
@max-hans this library (react-postprocessing) is a thin react abstraction over postprocessing. If you use postprocessing API's directly instead of this library you will likely not run into this issue (but will also have to do lifecycle management yourself).