Skip to content

Commit

Permalink
Fixed some memory leaking
Browse files Browse the repository at this point in the history
  • Loading branch information
jussi-kalliokoski committed Dec 4, 2011
1 parent b42657d commit 7ff7033
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions feature-detects/workers-dataworkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
worker = new Worker('data:text/javascript;base64,dGhpcy5vbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7cG9zdE1lc3NhZ2UoZS5kYXRhKX0=');

worker.onmessage = function(e) {
worker.terminate();
Modernizr.addTest('dataworkers', data === e.data);
worker = null;
};

// Just in case...
worker.onerror = function() {
Modernizr.addTest('dataworkers', false);
worker = null;
};

setTimeout(function() {
Expand Down

0 comments on commit 7ff7033

Please sign in to comment.