mirror of
https://github.com/jbagg/QtZeroConf.git
synced 2025-09-26 04:50:56 +02:00
Bonjour - destroy resolvers by resolvers list, not service list
If stopBrowser is called after a resolve starts, but before the resolve finished, the service is never added to the services list. This leaves the resolver active and it fires when resolving completes after stopBrowser() has destroyed a bunch of objects. Fix is to destroy resolves according to resolvers list and destroy services according to services list.
This commit is contained in:
11
bonjour.cpp
11
bonjour.cpp
@@ -239,12 +239,11 @@ void QZeroConfPrivate::cleanUp(DNSServiceRef toClean)
|
||||
else if (toClean == browser) {
|
||||
browser = nullptr;
|
||||
browserNotifier.clear();
|
||||
QMap<QString, QZeroConfService >::iterator i;
|
||||
for (i = pub->services.begin(); i != pub->services.end(); i++) {
|
||||
QString key = (*i)->name() + QString::number((*i)->interfaceIndex());
|
||||
resolvers[key]->cleanUp();
|
||||
emit pub->serviceRemoved(*i);
|
||||
}
|
||||
for (auto resolver : resolvers)
|
||||
resolver->cleanUp();
|
||||
resolvers.clear();
|
||||
for (auto service : pub->services)
|
||||
emit pub->serviceRemoved(service);
|
||||
pub->services.clear();
|
||||
}
|
||||
else if (toClean == dnssRef) {
|
||||
|
Reference in New Issue
Block a user