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) {
|
else if (toClean == browser) {
|
||||||
browser = nullptr;
|
browser = nullptr;
|
||||||
browserNotifier.clear();
|
browserNotifier.clear();
|
||||||
QMap<QString, QZeroConfService >::iterator i;
|
for (auto resolver : resolvers)
|
||||||
for (i = pub->services.begin(); i != pub->services.end(); i++) {
|
resolver->cleanUp();
|
||||||
QString key = (*i)->name() + QString::number((*i)->interfaceIndex());
|
resolvers.clear();
|
||||||
resolvers[key]->cleanUp();
|
for (auto service : pub->services)
|
||||||
emit pub->serviceRemoved(*i);
|
emit pub->serviceRemoved(service);
|
||||||
}
|
|
||||||
pub->services.clear();
|
pub->services.clear();
|
||||||
}
|
}
|
||||||
else if (toClean == dnssRef) {
|
else if (toClean == dnssRef) {
|
||||||
|
Reference in New Issue
Block a user