diff options
author | Eitan Isaacson <eitan@monotonous.org> | 2021-07-14 16:40:33 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-07-14 16:40:33 +0000 |
commit | 684000d9a5be65aaea5864ae1869d7cab737e089 (patch) | |
tree | 33d5e48a53312c6a67dd230f9d3001b0c785ee98 /accessible/base | |
parent | 00f9e243685f172861348f4a3f3f88b9ca6aed7c (diff) | |
download | uxp-684000d9a5be65aaea5864ae1869d7cab737e089.tar.gz |
[accessibility] Remove selection listeners from shutting down PresShell.
Diffstat (limited to 'accessible/base')
-rw-r--r-- | accessible/base/SelectionManager.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/accessible/base/SelectionManager.cpp b/accessible/base/SelectionManager.cpp index 30e01cbfcd..662ba52b70 100644 --- a/accessible/base/SelectionManager.cpp +++ b/accessible/base/SelectionManager.cpp @@ -120,6 +120,24 @@ SelectionManager::RemoveDocSelectionListener(nsIPresShell* aPresShell) // selection. Selection* spellSel = frameSel->GetSelection(SelectionType::eSpellCheck); spellSel->RemoveSelectionListener(this); + + if (mCurrCtrlNormalSel) { + if (mCurrCtrlNormalSel->GetPresShell() == aPresShell) { + // Remove 'this' registered as selection listener for the normal selection + // if we are removing listeners for its PresShell. + mCurrCtrlNormalSel->RemoveSelectionListener(this); + mCurrCtrlNormalSel = nullptr; + } + } + + if (mCurrCtrlSpellSel) { + if (mCurrCtrlSpellSel->GetPresShell() == aPresShell) { + // Remove 'this' registered as selection listener for the spellcheck + // selection if we are removing listeners for its PresShell. + mCurrCtrlSpellSel->RemoveSelectionListener(this); + mCurrCtrlSpellSel = nullptr; + } + } } void |