cabana: fix UI hang when switching streams (#36735)

fix UI hang when switching streams
This commit is contained in:
Dean Lee
2025-12-09 08:36:55 +08:00
committed by GitHub
parent a6645a1be1
commit 4e74e0f755
3 changed files with 11 additions and 2 deletions
+9 -1
View File
@@ -313,11 +313,19 @@ void MainWindow::loadFromClipboard(SourceSet s, bool close_all) {
}
void MainWindow::openStream(AbstractStream *stream, const QString &dbc_file) {
if (can) {
QObject::connect(can, &QObject::destroyed, this, [=]() { startStream(stream, dbc_file); });
can->deleteLater();
} else {
startStream(stream, dbc_file);
}
}
void MainWindow::startStream(AbstractStream *stream, QString dbc_file) {
center_widget->clear();
delete messages_widget;
delete video_splitter;
delete can;
can = stream;
can->setParent(this); // take ownership
can->start();
+1
View File
@@ -44,6 +44,7 @@ signals:
void updateProgressBar(uint64_t cur, uint64_t total, bool success);
protected:
void startStream(AbstractStream *stream, QString dbc_file);
bool eventFilter(QObject *obj, QEvent *event) override;
void remindSaveChanges();
void closeFile(SourceSet s = SOURCE_ALL);
+1 -1
View File
@@ -63,7 +63,6 @@ void Replay::setupSegmentManager(bool has_filters) {
}
Replay::~Replay() {
seg_mgr_.reset();
if (stream_thread_.joinable()) {
rInfo("shutdown: in progress...");
interruptStream([this]() {
@@ -74,6 +73,7 @@ Replay::~Replay() {
rInfo("shutdown: done");
}
camera_server_.reset();
seg_mgr_.reset();
}
bool Replay::load() {