mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1114554 - Patch 9 - Fixed crash in b2g-desktop tests. r=nsm
--HG-- extra : rebase_source : 1b59acf04bcc9a8311bc7c6fe163b99c84eabe35
This commit is contained in:
parent
16a5e3f9b8
commit
25dfda5b20
@ -1148,6 +1148,15 @@ NotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
}
|
||||
}
|
||||
} else if (!strcmp("alertfinished", aTopic)) {
|
||||
// In b2g-desktop, if the app is closed, closing a notification still
|
||||
// triggers the observer which might be alive even though the owner window
|
||||
// was closed. Keeping this until we remove the close event (Bug 1139363)
|
||||
// from implementation.
|
||||
nsCOMPtr<nsPIDOMWindow> window = notification->GetOwner();
|
||||
if (NS_WARN_IF(!window || !window->IsCurrentInnerWindow())) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
notification->UnpersistNotification();
|
||||
notification->mIsClosed = true;
|
||||
notification->DispatchTrustedEvent(NS_LITERAL_STRING("close"));
|
||||
|
Loading…
Reference in New Issue
Block a user