Skip to content

Instantly share code, notes, and snippets.

@peregrinogris
Created February 4, 2011 00:34
Show Gist options
  • Save peregrinogris/810521 to your computer and use it in GitHub Desktop.
Save peregrinogris/810521 to your computer and use it in GitHub Desktop.
Testcase for memory leak on widgets
const widgets = require("widget");
const timer = require("timer");
var instance = 0;
var widget = widgets.Widget({
label: "Mozilla website",
content: instance.toString(),
onClick: function() {
tabs.open("http://www.mozilla.org/");
}
});
timer.setInterval(function(){
widget.destroy();
instance++;
widget = widgets.Widget({
label: "Mozilla website",
content: instance.toString(),
onClick: function() {
tabs.open("http://www.mozilla.org/");
}
});
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment