Skip to content

Commit 0a3cbf5

Browse files
author
Anduin Withers
committed
References #4383
Make m_addressList local to SendNotifyMsg, this is the last stop before true avoidance with a switch to QWaitCondition and letting the task queue send the disable (would also prevent the double that can/will happen now). git-svn-id: http://svn.mythtv.org/svn/trunk@15286 7dbf422c-18fa-0310-86e9-fd20926502f2
1 parent f6f8977 commit 0a3cbf5

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

mythtv/libs/libmythupnp/upnptasknotify.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,16 @@ void UPnpNotifyTask::SendNotifyMsg( QSocketDevice *pSocket,
8989
// .arg( sUSN ));
9090

9191
{
92-
QMutexLocker qml(&m_mutex); // for m_addressList
93-
for ( QStringList::Iterator it = m_addressList.begin();
94-
it != m_addressList.end();
92+
QMutexLocker qml(&m_mutex); // for addressList
93+
94+
// ----------------------------------------------------------------------
95+
// Refresh IP Address List in case of changes
96+
// ----------------------------------------------------------------------
97+
98+
QStringList addressList = QDeepCopy<QStringList>(UPnp::g_IPAddrList);
99+
100+
for ( QStringList::Iterator it = addressList.begin();
101+
it != addressList.end();
95102
++it )
96103
{
97104
if (!*it)
@@ -134,12 +141,6 @@ void UPnpNotifyTask::Execute( TaskQueue *pQueue )
134141
QSocketDevice *pMulticast = new QMulticastSocket( SSDP_GROUP , SSDP_PORT );
135142
// QSocketDevice *pBroadcast = new QBroadcastSocket( "255.255.255.255", SSDP_PORT );
136143

137-
// ----------------------------------------------------------------------
138-
// Refresh IP Address List in case of changes
139-
// ----------------------------------------------------------------------
140-
141-
m_addressList = QDeepCopy<QStringList>(UPnp::g_IPAddrList);
142-
143144
// ----------------------------------------------------------------------
144145
// Must send rootdevice Notification for first device.
145146
// ----------------------------------------------------------------------

mythtv/libs/libmythupnp/upnptasknotify.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ class UPnpNotifyTask : public Task
5656
int m_nMaxAge;
5757

5858
UPnpNotifyNTS m_eNTS;
59-
60-
QStringList m_addressList;
61-
6259

6360
protected:
6461

0 commit comments

Comments
 (0)