Closed
Bug 725603
Opened 13 years ago
Closed 13 years ago
Leak in cuddlefish.js (with add-on Copy Tiny Url 0.4), many compartments system principal
Categories
(Add-on SDK Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: aryx, Unassigned)
References
Details
(Keywords: memory-leak, Whiteboard: [MemShrink:P3])
Attachments
(2 files)
Firefox 10.0 32-bit Windows XP SP 3
Firefox Nightly 2012-02-08 Windows XP SP 3
If you install the Copy Tiny Url add-on in version 0.4 (see attachment), there are many compartments System Principal even after disabling the add-on, nightly blames cuddlefish.js for these.
Steps to reproduce:
1. Create a new profile.
2. Install the add-on.
3. Open the add-on manager, disable the add-on.
4. Open about:memory?verbose and close all other tabs.
5. Click 'Minimize memory usage'.
Actual result:
Still many compartments like this:
compartment([System Principal], resource://jid1-epxk6cb8p5cx9w-at-jetpack/api-utils/lib/cuddlefish.js, 0x55b0000)
Add-on SDK version is 1.4.3
The main.js contains this:
var data = require("self").data;
var Request = require("request").Request;
const tabs = require("tabs");
let clipboard = require("clipboard");
var copy_tinyurl = {
onTrack: function (window) {
var doc = window.document;
if (doc.documentElement.getAttribute("windowtype") !== "navigator:browser") return;
// Modify the window!
if (doc.getElementById("urlbar") !== null && doc.getElementById("copy_tinyurl_icon") === null) {
var urlbar = doc.getElementById("urlbar");
var urlbarIcons = doc.getElementById("urlbar-icons");
var copy_tinyurl_icon = doc.createElement('a');
copy_tinyurl_icon.id = "copy_tinyurl_icon";
copy_tinyurl_icon.class = "urlbar-icon";
copy_tinyurl_icon.hidden = false;
copy_tinyurl_icon.style.display = "inline-block";
copy_tinyurl_icon.style.width = "16px";
copy_tinyurl_icon.style.height = "16px";
copy_tinyurl_icon.style.background = "url(" + data.url("icon-16.png") + ")";
copy_tinyurl_icon.onclick = function () {
if (tabs.activeTab.url.indexOf("http://") == 0 || tabs.activeTab.url.indexOf("https://") == 0) {
Request({
url: "http://tinyurl.com/api-create.php?url=" + encodeURIComponent(tabs.activeTab.url),
onComplete: function (response) {
clipboard.set(response.text);
urlbar.value = response.text;
}
}).get();
}
}
urlbarIcons.appendChild(copy_tinyurl_icon);
}
},
onUntrack: function (window) {
// Clean up
var doc = window.document;
if (doc.documentElement.getAttribute("windowtype") !== "navigator:browser") return;
// Modify the window!
if (doc.getElementById("copy_tinyurl_icon") !== null) {
var copy_tinyurl_icon = doc.getElementById("copy_tinyurl_icon");
copy_tinyurl_icon.parentNode.removeChild(copy_tinyurl_icon);
}
}
};
var winUtils = require("window-utils");
var tracker = new winUtils.WindowTracker(copy_tinyurl);
Reporter | ||
Comment 1•13 years ago
|
||
Comment 2•13 years ago
|
||
Alex, is this the same as bug 724433, or fixed by your patch there?
Depends on: 724433
Whiteboard: [MemShrink] → [triage:followup][MemShrink]
Updated•13 years ago
|
Blocks: LeakyAddons
Comment 3•13 years ago
|
||
Bug 726485 sounds rather similar, and it wasn't fixed by bug 724433, IIUC.
Comment 4•13 years ago
|
||
I think that you shouldn't be leaking with bug 724433 being fixed,
if you remove const tabs = require("tabs"); and stop using this API.
`tabs` requires `windows` which is leaking.
Otherwise, it should be completely fixed though bug 724404.
Updated•13 years ago
|
Whiteboard: [triage:followup][MemShrink] → [triage:followup][MemShrink:P3]
It is fixed by bug 724433 and bug 724404.
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Whiteboard: [triage:followup][MemShrink:P3] → [MemShrink:P3]
You need to log in
before you can comment on or make changes to this bug.
Description
•