forked from jbagg/QtZeroConf
Bonjour - Fix memory leak and service rediscovery
The QSocketNotifiers for the resolver and address were not being deleted in cleanUp(). This would cause a memory leak and also prevent a service from being rediscovered after removed and added back on another device. I suspect the undeleted QSocketNotifier was holding a file descriptor open which would break things. Should fix issue #27 Power-Cycling Bonjour Devices Can Cause Permanent Loss https://github.com/jbagg/QtZeroConf/issues/27 and pull request #34 macOS: Fixed undetected service stop/start while the application is running https://github.com/jbagg/QtZeroConf/pull/34
This commit is contained in:
@ -47,6 +47,8 @@ void Resolver::cleanUp()
|
||||
{
|
||||
DNSServiceRefDeallocate(DNSresolverRef);
|
||||
DNSServiceRefDeallocate(DNSaddressRef);
|
||||
delete resolverNotifier;
|
||||
delete addressNotifier;
|
||||
QString key = zcs->name() + QString::number(zcs->interfaceIndex());
|
||||
ref->resolvers.remove(key);
|
||||
delete this;
|
||||
|
Reference in New Issue
Block a user