From e8764d322cebeacfd23b01b9542112c3d072d654 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Mon, 3 Oct 2022 10:35:47 +0800 Subject: [PATCH] fix: access violation --- scanpopup.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scanpopup.cc b/scanpopup.cc index dacce48e..26197c54 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -1136,11 +1136,15 @@ void ScanPopup::altModePoll() void ScanPopup::pageLoaded( ArticleView * ) { - - - definition->hasSound([this](bool has){ - ui.pronounceButton->setVisible( has ); - }); + if( !isVisible() ) + return; + auto pronounceBtn = ui.pronounceButton; + definition->hasSound( + [ pronounceBtn ]( bool has ) + { + if( pronounceBtn ) + pronounceBtn->setVisible( has ); + } ); updateBackForwardButtons();