Bug 883059 - Check if the document is defunct before handling observer notifications. r=surkov, a=lsblakk
authorTrevor Saunders <trev.saunders@gmail.com>
Thu, 02 Jan 2014 09:46:21 -0500
changeset 167805 5a92c34bbba2ff1c1612075190dbb4de0c45d63e
parent 167804 ec83301af0dc80f5f0020b45eb76e7d938d079f3
child 167806 546cc1be7a49e0770e1335a64c0704c9ae602b35
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov, lsblakk
bugs883059
milestone27.0
Bug 883059 - Check if the document is defunct before handling observer notifications. r=surkov, a=lsblakk
accessible/src/generic/DocAccessible.cpp
--- a/accessible/src/generic/DocAccessible.cpp
+++ b/accessible/src/generic/DocAccessible.cpp
@@ -795,16 +795,19 @@ DocAccessible::ScrollPositionDidChange(n
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIObserver
 
 NS_IMETHODIMP
 DocAccessible::Observe(nsISupports* aSubject, const char* aTopic,
                        const PRUnichar* aData)
 {
+  if (IsDefunct())
+    return NS_OK;
+
   if (!nsCRT::strcmp(aTopic,"obs_documentCreated")) {    
     // State editable will now be set, readonly is now clear
     // Normally we only fire delayed events created from the node, not an
     // accessible object. See the AccStateChangeEvent constructor for details
     // about this exceptional case.
     nsRefPtr<AccEvent> event =
       new AccStateChangeEvent(this, states::EDITABLE, true);
     FireDelayedEvent(event);