summaryrefslogtreecommitdiffstats
path: root/src/net/mcast/McastPGMSocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/mcast/McastPGMSocket.cpp')
-rw-r--r--src/net/mcast/McastPGMSocket.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/net/mcast/McastPGMSocket.cpp b/src/net/mcast/McastPGMSocket.cpp
index 105bea9..7952f00 100644
--- a/src/net/mcast/McastPGMSocket.cpp
+++ b/src/net/mcast/McastPGMSocket.cpp
@@ -567,6 +567,11 @@ void McastPGMSocket::sendPacket(QByteArray const& bytes)
void McastPGMSocket::finish()
{
+ if (_finished)
+ {
+ return;
+ }
+
qDebug() << "finish()";
Q_FOREACH(QSocketNotifier* notif, _priv->_notifs)
@@ -582,8 +587,11 @@ void McastPGMSocket::finish()
_priv->send_notif = 0;
}
- pgm_close(_priv->socket, 1);
- _priv->socket = 0;
+ if (_priv->socket)
+ {
+ pgm_close(_priv->socket, 1);
+ _priv->socket = 0;
+ }
_finished = true;