With my recent changes, I introduced a leak of the canvas gradient object.
Created attachment 7167 [details] patch with detailed change log
Comment on attachment 7167 [details] patch with detailed change log Looks good. Eventually it would be nice to merge some of this code with the SVG code. Probably more of making the SVG gradient code sit on top of this stuff.