Bug 581166, part 2: Avoid passing null argument to RemoveEditActionListener in ~nsPlainTextEditor, to quiet 2 NS_ENSURE_TRUE warnings at shutdown time. r=ehsan a=bsmedberg

This commit is contained in:
Daniel Holbert 2010-07-26 12:11:09 -07:00
parent 70ea3959c5
commit 31c8318893

View File

@ -109,10 +109,12 @@ nsPlaintextEditor::nsPlaintextEditor()
nsPlaintextEditor::~nsPlaintextEditor()
{
// remove the rules as an action listener. Else we get a bad ownership loop later on.
// it's ok if the rules aren't a listener; we ignore the error.
nsCOMPtr<nsIEditActionListener> mListener = do_QueryInterface(mRules);
RemoveEditActionListener(mListener);
// remove the rules as an action listener. Else we get a bad ownership loop
// later on. it's ok if the rules aren't a listener; we ignore the error.
if (mRules) {
nsCOMPtr<nsIEditActionListener> mListener = do_QueryInterface(mRules);
RemoveEditActionListener(mListener);
}
// Remove event listeners. Note that if we had an HTML editor,
// it installed its own instead of these