]> sigrok.org Git - pulseview.git/commitdiff
Fix remaining invalid disconnect() calls
authorSoeren Apel <redacted>
Sat, 12 Dec 2020 21:47:45 +0000 (22:47 +0100)
committerSoeren Apel <redacted>
Sat, 12 Dec 2020 22:27:33 +0000 (23:27 +0100)
pv/data/mathsignal.cpp
pv/toolbars/mainbar.cpp
pv/views/tabular_decoder/model.cpp

index f7de2ff29103a0662e1dce62a74cb33a8372203c..adb27131e6d43bc00a89e788cf398c07ed57229a 100644 (file)
@@ -307,8 +307,13 @@ void MathSignal::begin_generation()
                return;
        }
 
-       disconnect(this, SLOT(on_data_received()));
-       disconnect(this, SLOT(on_enabled_changed()));
+       disconnect(&session_, SIGNAL(data_received()), this, SLOT(on_data_received()));
+
+       for (const shared_ptr<SignalBase>& sb : session_.signalbases()) {
+               if (sb->analog_data())
+                       disconnect(sb->analog_data().get(), nullptr, this, SLOT(on_data_received()));
+               disconnect(sb.get(), nullptr, this, SLOT(on_enabled_changed()));
+       }
 
        fnc_sample_ = new fnc_sample<double>(*this);
 
@@ -371,8 +376,7 @@ void MathSignal::begin_generation()
        if (error_message_.isEmpty()) {
                // Connect to the session data notification if we have no input signals
                if (input_signals_.empty())
-                       connect(&session_, SIGNAL(data_received()),
-                               this, SLOT(on_data_received()));
+                       connect(&session_, SIGNAL(data_received()),     this, SLOT(on_data_received()));
 
                gen_interrupt_ = false;
                gen_thread_ = std::thread(&MathSignal::generation_proc, this);
index b35e14661373d88325eb4a28c1d73a580d587e4f..39c290dfb2c8a2c34499928bafd600eb227a4030 100644 (file)
@@ -548,7 +548,7 @@ void MainBar::update_device_config_widgets()
                sample_count_supported_ = true;
 
        // Add notification of reconfigure events
-       disconnect(this, SLOT(on_config_changed()));
+       // Note: No need to disconnect the previous signal as that QObject instance is destroyed
        connect(&opts->binding(), SIGNAL(config_changed()),
                this, SLOT(on_config_changed()));
 
index e7a199f13da19248016e61e16d4c9065e1ac589f..337f4ce9ae1d02d46ffba8dc903162d5d6a2d468 100644 (file)
@@ -228,7 +228,8 @@ void AnnotationCollectionModel::set_signal_and_segment(data::DecodeSignal* signa
                return;
        }
 
-       disconnect(this, SLOT(on_annotation_visibility_changed()));
+       for (const shared_ptr<Decoder>& dec : signal_->decoder_stack())
+               disconnect(dec.get(), nullptr, this, SLOT(on_annotation_visibility_changed()));
 
        all_annotations_ = signal->get_all_annotations_by_segment(current_segment);
        signal_ = signal;