summaryrefslogtreecommitdiff
path: root/accessible
diff options
context:
space:
mode:
authorEitan Isaacson <eitan@monotonous.org>2021-07-14 16:40:33 +0000
committerMoonchild <moonchild@palemoon.org>2021-07-14 16:40:33 +0000
commit684000d9a5be65aaea5864ae1869d7cab737e089 (patch)
tree33d5e48a53312c6a67dd230f9d3001b0c785ee98 /accessible
parent00f9e243685f172861348f4a3f3f88b9ca6aed7c (diff)
downloaduxp-684000d9a5be65aaea5864ae1869d7cab737e089.tar.gz
[accessibility] Remove selection listeners from shutting down PresShell.
Diffstat (limited to 'accessible')
-rw-r--r--accessible/base/SelectionManager.cpp18
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