add:   var progress = Components.classes["@mozilla.org/docloaderservice;1"]. getService(Components.interfaces.nsIWebProgress);  progress.removeProgressListener(torbutton_weblistener); torbutton_unique_pref_observer.unregister(); torbutton_uninstall_observer.unregister();  
context: function torbutton_close_window(event) {    torbutton_window_pref_observer.unregister();    // XXX: This is a real ghetto hack.. When the original window    // closes, we need to find another window to handle observing     // unique events... The right way to do this is to move the     // majority of torbutton functionality into a XPCOM component..     // But that is a major overhaul..    if (m_tb_is_main_window) {        torbutton_log(3, "Original window closed. Searching for another");        var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]            .getService(Components.interfaces.nsIWindowMediator);        var enumerator = wm.getEnumerator("navigator:browser");        while(enumerator.hasMoreElements()) {            var win = enumerator.getNext();            if(win != window) {                torbutton_log(3, "Found another window");                win.torbutton_do_main_window_startup();                break;            }        }    }}
meta: 3444	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3444/5822b3c73c783e1fab59be647263a42a7a15ea8f/torbutton.js/buggy/src/chrome/content/torbutton.js