Opened 13 years ago

Last modified 13 years ago

#495 closed defect (Fixed)

Memory leaks in torbutton

Reported by: arno Owned by: mikeperry
Priority: Low Milestone:
Component: Applications/Torbutton Version: 1.1
Severity: Keywords:
Cc: arno, nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


I noticed some memory leaks in torbutton.
So, I tested with development branch, and they were still here. Those leaks come
from pref observer not being removed during window unloading. When you use
just one window, that's not a big deal, but if you use multiple, some
javascripts objects are leaked each time.

Here is a patch to apply against last version
( 1.1.6 30 Jul 2007)

PS: I noticed those leaks with leak monitor, a nice tool for xul developers:

--- torbutton.js 2007-09-06 23:29:18.000000000 +0200
+++ /home/arno/.mozilla/firefox/qrp98gfd.tes/extensions/{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}/chrome/content/torbutton.js 2007-09-06 23:31:59.000000000 +0200
@@ -20,7 +20,7 @@

unregister: function()

if (!this._branch) return;

  • this._branch.removeOberver("", this);

+ this._branch.removeObserver("", this);


topic: what event occurred

@@ -838,6 +838,10 @@



+function torbutton_close_window(event) {
+ torbutton_pref_observer.unregister();

Technique courtesy of:

@@ -884,6 +888,7 @@



+window.addEventListener('unload', torbutton_close_window, false);

getBrowser().addEventListener("TabOpen", torbutton_new_tab, false);

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (2)

comment:1 Changed 13 years ago by nickm

(Changed bug desription to "Memory leaks in torbutton" from "Kxv2lCt*". I hope that wasn't your password or something.)

comment:2 Changed 13 years ago by mikeperry

flyspray2trac: bug closed.
Patch applied, it will go in my next commit. Thanks!

Note: See TracTickets for help on using tickets.