Skip to content

Commit 3ef9054

Browse files
committed
Don't trigger a nodesChanged event when successive connections fail
1 parent c78a31e commit 3ef9054

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

aseba.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ AsebaClient::AsebaClient(): stream(nullptr) {
106106
}, Qt::DirectConnection);
107107
QObject::connect(&hub, &DashelHub::error, this, [this](QString source, QString reason) {
108108
manager.reset();
109-
for (auto node: nodes) {
110-
delete node;
109+
if (!nodes.empty()) {
110+
for (auto node: nodes) {
111+
delete node;
112+
}
113+
nodes.clear();
114+
emit this->nodesChanged();
111115
}
112-
nodes.clear();
113-
emit this->nodesChanged();
114116
emit this->connectionError(source, reason);
115117
}, Qt::QueuedConnection);
116118

0 commit comments

Comments
 (0)