Commit a8240d22 authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #4468 from otaviobp/socket_error

Fix crash by invalid socket deletion
parents 6422b180 a84be5e6
...@@ -80,7 +80,7 @@ void VideoReceiver::_connected() ...@@ -80,7 +80,7 @@ void VideoReceiver::_connected()
{ {
//-- Server showed up. Now we start the stream. //-- Server showed up. Now we start the stream.
_timer.stop(); _timer.stop();
delete _socket; _socket->deleteLater();
_socket = NULL; _socket = NULL;
_serverPresent = true; _serverPresent = true;
start(); start();
...@@ -91,7 +91,7 @@ void VideoReceiver::_connected() ...@@ -91,7 +91,7 @@ void VideoReceiver::_connected()
void VideoReceiver::_socketError(QAbstractSocket::SocketError socketError) void VideoReceiver::_socketError(QAbstractSocket::SocketError socketError)
{ {
Q_UNUSED(socketError); Q_UNUSED(socketError);
delete _socket; _socket->deleteLater();
_socket = NULL; _socket = NULL;
//-- Try again in 5 seconds //-- Try again in 5 seconds
_timer.start(5000); _timer.start(5000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment