summaryrefslogtreecommitdiff
path: root/dom/base
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-09-29 15:03:13 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-09-29 15:03:13 -0400
commit96b775f4bf48bbdb4e31186e7c7ae550aa6a120a (patch)
treefbef557f50d316d6c750ba1af1509f8ace103d79 /dom/base
parent1fcf1965670ad5b6685fd1713fbec3725c3cece4 (diff)
downloaduxp-96b775f4bf48bbdb4e31186e7c7ae550aa6a120a.tar.gz
Issue mcp-graveyard/UXP#1643 - Follow up: Add a null check for mOwner in ResizeObserverNotificationHelper::Unregister
A race condition seemed to exist between tab destruction and un-registering a ResizeObserver resulting in a null deref crash. The original reporter in Forum Topic 25311 experienced this on msn.com so that was the functional test reference.
Diffstat (limited to 'dom/base')
-rw-r--r--dom/base/ResizeObserverController.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/dom/base/ResizeObserverController.cpp b/dom/base/ResizeObserverController.cpp
index 7a6e6ba449..117e67fbfd 100644
--- a/dom/base/ResizeObserverController.cpp
+++ b/dom/base/ResizeObserverController.cpp
@@ -58,6 +58,12 @@ ResizeObserverNotificationHelper::Register()
void
ResizeObserverNotificationHelper::Unregister()
{
+ if (!mOwner) {
+ // We've outlived our owner, so there's nothing registered anymore.
+ mRegistered = false;
+ return;
+ }
+
if (!mRegistered) {
return;
}