From 366c0a3fca91ec8229f95a7583f8fefad2d32350 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Thu, 12 Sep 2013 10:13:47 -0500 Subject: [PATCH] Give the Garbage collector a clue to recycle images; avoids fairly massive memory leaks during video playback. --- display.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/display.js b/display.js index f9bfe76..d0d0994 100644 --- a/display.js +++ b/display.js @@ -778,6 +778,10 @@ function handle_draw_jpeg_onload() { context.drawImage(this, this.o.base.box.left, this.o.base.box.top); + // Give the Garbage collector a clue to recycle this; avoids + // fairly massive memory leaks during video playback + this.src = null; + if (this.o.descriptor && (this.o.descriptor.flags & SPICE_IMAGE_FLAGS_CACHE_ME)) {