aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-03-12 10:18:53 +0000
committerSaturneric <[email protected]>2022-03-12 10:18:53 +0000
commit05322c890255487595dc0fd98a70cb9796c2fbb0 (patch)
treec8c0b867b74fa7862fb26fce29112bafa0f83230
parent<fix>(ui): Improve UI experience (diff)
downloadGpgFrontend-05322c890255487595dc0fd98a70cb9796c2fbb0.tar.gz
GpgFrontend-05322c890255487595dc0fd98a70cb9796c2fbb0.zip
<fix>(ui): Fix crash after opening a PlainTextEditorPage
-rw-r--r--src/ui/widgets/PlainTextEditorPage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/widgets/PlainTextEditorPage.cpp b/src/ui/widgets/PlainTextEditorPage.cpp
index 2a6413bd..0161bf91 100644
--- a/src/ui/widgets/PlainTextEditorPage.cpp
+++ b/src/ui/widgets/PlainTextEditorPage.cpp
@@ -166,7 +166,7 @@ void PlainTextEditorPage::ReadFile() {
connect(this, &PlainTextEditorPage::destroyed, [=]() {
LOG(INFO) << "request interruption for read thread";
- thread->requestInterruption();
+ if (read_thread_ && thread->isRunning()) thread->requestInterruption();
read_thread_ = nullptr;
});
this->read_thread_ = thread;