From 39af453281c9b92de37d50f622831223bfc62103 Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 21 Mar 2013 15:13:08 +0100 Subject: [PATCH] [AKN] Fixes crash while closing tab with shown labels. See #817 --- src/plugins/AccessKeysNavigation/akn_handler.cpp | 7 +++++++ src/plugins/AccessKeysNavigation/akn_plugin.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/AccessKeysNavigation/akn_handler.cpp b/src/plugins/AccessKeysNavigation/akn_handler.cpp index 2370331c2..ce6491e2a 100644 --- a/src/plugins/AccessKeysNavigation/akn_handler.cpp +++ b/src/plugins/AccessKeysNavigation/akn_handler.cpp @@ -320,6 +320,13 @@ void AKN_Handler::showAccessKeys() void AKN_Handler::hideAccessKeys() { if (!m_accessKeyLabels.isEmpty() && m_view) { + // Fixes crash when hiding labels while closing view + if (!m_view->inherits("WebView")) { + m_accessKeyLabels.clear(); + m_accessKeyNodes.clear(); + return; + } + for (int i = 0; i < m_accessKeyLabels.count(); ++i) { QLabel* label = m_accessKeyLabels[i]; label->hide(); diff --git a/src/plugins/AccessKeysNavigation/akn_plugin.cpp b/src/plugins/AccessKeysNavigation/akn_plugin.cpp index eb3cec43f..e672ea036 100644 --- a/src/plugins/AccessKeysNavigation/akn_plugin.cpp +++ b/src/plugins/AccessKeysNavigation/akn_plugin.cpp @@ -36,7 +36,7 @@ PluginSpec AKN_Plugin::pluginSpec() spec.name = "Access Keys Navigation"; spec.info = "Access keys navigation for QupZilla"; spec.description = "Provides support for navigating in webpages by keyboard shortcuts"; - spec.version = "0.4.2"; + spec.version = "0.4.3"; spec.author = "David Rosca "; spec.icon = QPixmap(":/accesskeysnavigation/data/icon.png"); spec.hasSettings = true;