summaryrefslogtreecommitdiffstats
path: root/widget/GfxInfoBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'widget/GfxInfoBase.cpp')
-rw-r--r--widget/GfxInfoBase.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp
index c937f5099..e20de8277 100644
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -43,6 +43,7 @@ using mozilla::MutexAutoLock;
nsTArray<GfxDriverInfo>* GfxInfoBase::mDriverInfo;
bool GfxInfoBase::mDriverInfoObserverInitialized;
+bool GfxInfoBase::mShutdownOccurred;
// Observes for shutdown so that the child GfxDriverInfo list is freed.
class ShutdownObserver : public nsIObserver
@@ -62,11 +63,17 @@ public:
delete GfxInfoBase::mDriverInfo;
GfxInfoBase::mDriverInfo = nullptr;
- for (uint32_t i = 0; i < DeviceFamilyMax; i++)
+ for (uint32_t i = 0; i < DeviceFamilyMax; i++) {
delete GfxDriverInfo::mDeviceFamilies[i];
+ GfxDriverInfo::mDeviceFamilies[i] = nullptr;
+ }
- for (uint32_t i = 0; i < DeviceVendorMax; i++)
+ for (uint32_t i = 0; i < DeviceVendorMax; i++) {
delete GfxDriverInfo::mDeviceVendors[i];
+ GfxDriverInfo::mDeviceVendors[i] = nullptr;
+ }
+
+ GfxInfoBase::mShutdownOccurred = true;
return NS_OK;
}
@@ -849,6 +856,13 @@ GfxInfoBase::GetFeatureStatusImpl(int32_t aFeature,
return NS_OK;
}
+ if (mShutdownOccurred) {
+ // This is futile; we've already commenced shutdown and our blocklists have
+ // been deleted. We may want to look into resurrecting the blocklist instead
+ // but for now, just don't even go there.
+ return NS_OK;
+ }
+
// If an operating system was provided by the derived GetFeatureStatusImpl,
// grab it here. Otherwise, the OS is unknown.
OperatingSystem os = (aOS ? *aOS : OperatingSystem::Unknown);