diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2019-02-14 10:42:04 +0100 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2019-02-19 15:27:55 +0000 |
commit | 0f2fe6447aa057587b08584a43767447e04982d9 (patch) | |
tree | c22119dca4f575439a02673981f804ecbf4904e9 /src/core/browser_accessibility_manager_qt.h | |
parent | 74d2d301b11f2edfde69f0515e2fd74882ab6dab (diff) |
Fix crash in tst_Spellchecking::spellcheck
The test tst_Spellchecking::spellcheck crashes when run with
QT_LOGGING_RULES=qt.accessibility.cache.debug=true
which triggers debug output from
QAccessible::registerAccessibleInterface and
QAccessible::deleteAccessibleInterface
These functions are called during the construction/destruction of
BrowserAccessibilityQt. The problem is that BrowserAccessibilityQt is not
necessarily in a valid state at these times: BrowserAccessibilityQt relies on
it's manager to be *fully* initialized yet BrowserAccessibilityQt may be
constructed/destructed *during* the managers construction/destruction.
The solution is to override QAccessibleInterface::isValid to return true only if
the manager is in a valid state too. This disables the debug output and avoids
the crash.
Fixes: QTBUG-72878
Change-Id: Icffe4e503145133c24535fb094bbcb606568e57c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/browser_accessibility_manager_qt.h')
-rw-r--r-- | src/core/browser_accessibility_manager_qt.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h index a2d6db458..87c8875ba 100644 --- a/src/core/browser_accessibility_manager_qt.h +++ b/src/core/browser_accessibility_manager_qt.h @@ -57,14 +57,17 @@ public: const ui::AXTreeUpdate& initialTree, BrowserAccessibilityDelegate* delegate, BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); + ~BrowserAccessibilityManagerQt() override; void FireBlinkEvent(ax::mojom::Event event_type, BrowserAccessibility* node) override; QAccessibleInterface *rootParentAccessible(); + bool isValid() const { return m_valid; } private: Q_DISABLE_COPY(BrowserAccessibilityManagerQt) QObject *m_parentObject; + bool m_valid = false; }; } |