I am trying to clear the contents of WebGL canvas.
Is it fine if I just delete the canvas element from DOM and create a new one, and most importantly, will it clear up all the resources and not cause any memory leak.
My scenario is that, I am getting images continuously via AJAX polling from the server every 20 seconds and using a hidden WebGL canvas to draw it and further using another canvas to show it perfectly.
Suggestions?