]> sigrok.org Git - pulseview.git/commitdiff
Fix #1400 by matching decoder selectors only for current session
authorSoeren Apel <redacted>
Tue, 5 Nov 2019 21:25:50 +0000 (22:25 +0100)
committerSoeren Apel <redacted>
Tue, 5 Nov 2019 21:30:50 +0000 (22:30 +0100)
pv/mainwindow.cpp

index db6db406e3e0f635ef809e594935642007d3575e..e79b045945c1b255c18826ce9ee77723adfbd949 100644 (file)
@@ -870,7 +870,10 @@ void MainWindow::on_show_decoder_selector(Session *session)
        // Close dock widget if it's already showing and return
        for (auto entry : sub_windows_) {
                QDockWidget* dock = entry.first;
-               if (dynamic_pointer_cast<subwindows::decoder_selector::SubWindow>(entry.second)) {
+               shared_ptr<subwindows::SubWindowBase> decoder_selector =
+                       dynamic_pointer_cast<subwindows::decoder_selector::SubWindow>(entry.second);
+
+               if (decoder_selector && (&decoder_selector->session() == session)) {
                        sub_windows_.erase(dock);
                        dock->close();
                        return;