diff options
author | David Major <dmajor@mozilla.com> | 2018-05-23 11:54:21 -0700 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-07 06:08:05 +0200 |
commit | 6b36aa089d31573cf9a72da530dc423b3978fda3 (patch) | |
tree | 1e4c3891c5f61f6eed4425d110601a89f5c9a09f /widget/GfxInfoBase.cpp | |
parent | 63d30436895af897f71c40669ca587b495d98649 (diff) | |
download | UXP-6b36aa089d31573cf9a72da530dc423b3978fda3.tar UXP-6b36aa089d31573cf9a72da530dc423b3978fda3.tar.gz UXP-6b36aa089d31573cf9a72da530dc423b3978fda3.tar.lz UXP-6b36aa089d31573cf9a72da530dc423b3978fda3.tar.xz UXP-6b36aa089d31573cf9a72da530dc423b3978fda3.zip |
Bug 1458270: Clean up in the shutdown observer. r=milan a=jcristau
--HG--
extra : amend_source : 7b1277a18a3ed4f441deef8b51cb4ec4dde614cc
Diffstat (limited to 'widget/GfxInfoBase.cpp')
-rw-r--r-- | widget/GfxInfoBase.cpp | 18 |
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); |