error when closing buffer during page load fixed
In buffer_container.kill_buffer, there is a line like the following,
which removes a buffer element from its buffer_container:
this.container.removeChild(b.element);
When the buffer in question has a webProgressListener, as the case with
content_buffer, that listener's onStateChange method gets called with
STATE_STOP and STATE_IS_NETWORK. In other words, the page stops loading,
because the browser it is in is being destroyed. This progress listener
in content_buffer responds to this particular message by trying to do
several things in the user interface, such as displaying a "Done" message
in the minibuffer. But when the destruction of the buffer is what
triggers these events, the attempted UI actions result in errors like
this:
Console error: [JavaScript Error: "this.container.selectedPanel is
undefined" {file: "chrome://conkeror/content/buffer.js" line: 271}]
Category: XPConnect JavaScript
This patch stops those errors by introducing a new method to `buffer'
and `content_buffer' called `destructor'. This destructor gets called
just before the offending removeChild, giving the content_buffer a chance
to remove its progress listener.