|
|
|
@ -179,7 +179,14 @@ var CachedCanvases = (function CachedCanvasesClosure() {
@@ -179,7 +179,14 @@ var CachedCanvases = (function CachedCanvasesClosure() {
|
|
|
|
|
return canvasEntry; |
|
|
|
|
}, |
|
|
|
|
clear: function () { |
|
|
|
|
cache = {}; |
|
|
|
|
for (var id in cache) { |
|
|
|
|
var canvasEntry = cache[id]; |
|
|
|
|
// Zeroing the width and height causes Firefox to release graphics
|
|
|
|
|
// resources immediately, which can greatly reduce memory consumption.
|
|
|
|
|
canvasEntry.canvas.width = 0; |
|
|
|
|
canvasEntry.canvas.height = 0; |
|
|
|
|
delete cache[id]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
})(); |
|
|
|
|