Undah (Memory) Pressha… do do do do do do do 0 ▲ SOS 1 hour ago · Tech · hide · 0 comments In Kidz Fun Art, I recently increased the resolution of images by two, letting young artists draw at much higher quality (important for my 10 year old who was hitting the limits of the program, she’s amazing). However this introduced an annoying crash on Safari where, after loading four or five images to edit, it would reload the browser from scratch. Not a great user experience. The Problem It turns out that too many Canvas DOM elements were not being cleaned up by the browser, even though they were garbage collected and no in the DOM. The app makes very liberal usage of temporarily created Canvas elements for manipulating pixels, and I had thought that simply letting the garbage collector clean them up, but this is apparently insufficient. The Fix There were over 80 places in the code that contained document.createElement("canvas") I initially replaced this with a simple function to make it easy to have one place to add debug logs. function makeSimpleCanvas() { return… No comments yet. Log in to reply on the Fediverse. Comments will appear here.