diff --git a/src/gui/src/ZeroconfBrowser.cpp b/src/gui/src/ZeroconfBrowser.cpp index eb173603..d45df3a6 100644 --- a/src/gui/src/ZeroconfBrowser.cpp +++ b/src/gui/src/ZeroconfBrowser.cpp @@ -28,6 +28,10 @@ ZeroconfBrowser::ZeroconfBrowser(QObject* parent) : ZeroconfBrowser::~ZeroconfBrowser() { + if (m_pSocket) { + delete m_pSocket; + } + if (m_DnsServiceRef) { DNSServiceRefDeallocate(m_DnsServiceRef); m_DnsServiceRef = 0; diff --git a/src/gui/src/ZeroconfRegister.cpp b/src/gui/src/ZeroconfRegister.cpp index ac49627b..dd713167 100644 --- a/src/gui/src/ZeroconfRegister.cpp +++ b/src/gui/src/ZeroconfRegister.cpp @@ -28,6 +28,10 @@ ZeroconfRegister::ZeroconfRegister(QObject* parent) : ZeroconfRegister::~ZeroconfRegister() { + if (m_pSocket) { + delete m_pSocket; + } + if (m_DnsServiceRef) { DNSServiceRefDeallocate(m_DnsServiceRef); m_DnsServiceRef = 0; @@ -49,7 +53,8 @@ void ZeroconfRegister::registerService(const ZeroconfRecord& record, } #endif - DNSServiceErrorType err = DNSServiceRegister(&m_DnsServiceRef, 0, 0, + DNSServiceErrorType err = DNSServiceRegister(&m_DnsServiceRef, + kDNSServiceFlagsNoAutoRename, 0, record.serviceName.toUtf8().constData(), record.registeredType.toUtf8().constData(), record.replyDomain.isEmpty() ? 0 : record.replyDomain.toUtf8().constData(),