summaryrefslogtreecommitdiff
blob: 8967fc788f5cbbda50b4dcb8a5d6219350aa0b7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 607390315750815b0009b95ecd65699e2a1d110a Mon Sep 17 00:00:00 2001
From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
Date: Thu, 11 Nov 2021 15:57:54 +0100
Subject: [PATCH] String extraction tool: fix crash with marked strings in
 closed view

BUG: 444405

FIXED-IN: 0.26.7
---
 .../controllers/view/stringsextract/stringsextracttool.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kasten/controllers/view/stringsextract/stringsextracttool.cpp b/kasten/controllers/view/stringsextract/stringsextracttool.cpp
index 0d629999a..bcb6b6734 100644
--- a/kasten/controllers/view/stringsextract/stringsextracttool.cpp
+++ b/kasten/controllers/view/stringsextract/stringsextracttool.cpp
@@ -58,7 +58,12 @@ QString StringsExtractTool::title() const { return i18nc("@title:window of the t
 void StringsExtractTool::setTargetModel(AbstractModel* model)
 {
     if (mByteArrayView) {
-        mByteArrayView->disconnect(this);
+        // disconnect explicitly from all connects but QObject::detroyed,
+        // for the case mSourceByteArrayView is mByteArrayView
+        disconnect(mByteArrayView,  &ByteArrayView::selectedDataChanged,
+                   this, &StringsExtractTool::onSelectionChanged);
+        disconnect(mByteArrayView, &ByteArrayView::offsetCodingChanged,
+                   this, &StringsExtractTool::offsetCodingChanged);
     }
 
     mByteArrayView = model ? model->findBaseModel<ByteArrayView*>() : nullptr;
-- 
GitLab