Bug 1525546 - Make sure a XULMenuItemAccessibleWrap is not going away when creating its keyboard shortcut info, r=Jamie a=lizzard
authorMarco Zehe <mzehe@mozilla.com>
Thu, 07 Feb 2019 07:05:29 +0000
changeset 512999 4967e7f39711308ee2e7f1b7d9420c5148d43d95
parent 512998 554276c96ebb63cf2e2afc82b4303d78af97b459
child 513000 733e8bfd0ba3743941128235f388af561fda3cea
push id10673
push userarchaeopteryx@coole-files.de
push dateMon, 11 Feb 2019 18:29:39 +0000
treeherdermozilla-beta@a61f757afab3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamie, lizzard
bugs1525546
milestone66.0
Bug 1525546 - Make sure a XULMenuItemAccessibleWrap is not going away when creating its keyboard shortcut info, r=Jamie a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D18922
accessible/windows/msaa/XULMenuAccessibleWrap.cpp
--- a/accessible/windows/msaa/XULMenuAccessibleWrap.cpp
+++ b/accessible/windows/msaa/XULMenuAccessibleWrap.cpp
@@ -41,16 +41,20 @@ XULMenuitemAccessibleWrap::get_accKeyboa
   if (!pszKeyboardShortcut) return E_INVALIDARG;
   *pszKeyboardShortcut = nullptr;
 
   if (varChild.vt != VT_I4 || varChild.lVal != CHILDID_SELF) {
     return AccessibleWrap::get_accKeyboardShortcut(varChild,
                                                    pszKeyboardShortcut);
   }
 
+  if (IsDefunct()) {
+    return CO_E_OBJNOTCONNECTED;
+  }
+
   KeyBinding keyBinding = AccessKey();
   if (keyBinding.IsEmpty()) {
     return S_FALSE;
   }
 
   nsAutoString shortcut;
   keyBinding.ToString(shortcut);