summaryrefslogtreecommitdiffstats
path: root/dom
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
commitfb086631d910323c04361fa30ac8004f6209ca30 (patch)
treefbef557f50d316d6c750ba1af1509f8ace103d79 /dom
parent4e72f8ed039e4b9e5f1fb08b6cf27e15598a201f (diff)
downloadUXP-fb086631d910323c04361fa30ac8004f6209ca30.tar
UXP-fb086631d910323c04361fa30ac8004f6209ca30.tar.gz
UXP-fb086631d910323c04361fa30ac8004f6209ca30.tar.lz
UXP-fb086631d910323c04361fa30ac8004f6209ca30.tar.xz
UXP-fb086631d910323c04361fa30ac8004f6209ca30.zip
Issue #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')
-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 7a6e6ba44..117e67fbf 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;
}