Bug 1961648, avoid using ObserverService late during shutdown, a=RyanVM DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D265675 Differential Revision: https://phabricator.services.mozilla.com/D268905
This commit is contained in:
committed by
rvandermeulen@mozilla.com
parent
45b12df108
commit
74ba37c339
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "EventStateManager.h"
|
#include "EventStateManager.h"
|
||||||
|
|
||||||
|
#include "mozilla/AppShutdown.h"
|
||||||
#include "mozilla/AsyncEventDispatcher.h"
|
#include "mozilla/AsyncEventDispatcher.h"
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "mozilla/EditorBase.h"
|
#include "mozilla/EditorBase.h"
|
||||||
@@ -302,7 +303,10 @@ NS_IMPL_ISUPPORTS(UITimerCallback, nsITimerCallback, nsINamed)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
UITimerCallback::Notify(nsITimer* aTimer) {
|
UITimerCallback::Notify(nsITimer* aTimer) {
|
||||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||||
if (!obs) return NS_ERROR_FAILURE;
|
// ObserverService shutdown happens after XPCOMShutdownThreads.
|
||||||
|
if (!obs || AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdownThreads)) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
if ((gMouseOrKeyboardEventCounter == mPreviousCount) || !aTimer) {
|
if ((gMouseOrKeyboardEventCounter == mPreviousCount) || !aTimer) {
|
||||||
gMouseOrKeyboardEventCounter = 0;
|
gMouseOrKeyboardEventCounter = 0;
|
||||||
obs->NotifyObservers(nullptr, "user-interaction-inactive", nullptr);
|
obs->NotifyObservers(nullptr, "user-interaction-inactive", nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user