title: What is the correct usage of Firefox ToggleButton?
body: <p>I'm writing and debugging a Firefox Addon using the SDK (version 1.16, Firefox version 31).</p>
  
  <p>I've been using the ToggleButton widget. I've noticed that when my extension is disabled in the <code>about:addons</code> menu, I see several 'TypeError: can't access dead object' message in toolbox console.  These messages show up when I activate, and open tabs.</p>
  
  <p>The following is the simple code from the example that will demonstrate this issue:</p>
  
  <pre><code>var ui = require("sdk/ui");
  
  var button = ui.ToggleButton({
      id: "my-button",
      label: "my button",
      icon: {
          "16": "./icon-16.png",
          "32": "./icon-32.png",
          "64": "./icon-64.png"
      },
      onClick: handleClick
  });
  
  function handleClick(state) {
    require("sdk/tabs").open("https://www.mozilla.org/");
  }
  
  exports.onUnload = function (reason) {
      console.log("onUnload", reason);
      button.destroy();   
  }
  </code></pre>
  
  <p>Do I need to do something differently (other than <code>destroy</code>) in the onUnload function?  </p>