Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Commit 30ac571

Browse files
authored
Fixed socket deletion error (#59)
* Fixed socket deletion error deleting the socket in the destructor can cause a crash when shutting down the app. By moving it to the socketDisconnected and deleting it with "deleteLater" fixed the issue * fixed intendation
1 parent 02a6e71 commit 30ac571

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/qhttpconnection.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ QHttpConnection::QHttpConnection(QTcpSocket *socket, QObject *parent)
6161

6262
QHttpConnection::~QHttpConnection()
6363
{
64-
delete m_socket;
6564
m_socket = 0;
6665

6766
free(m_parser);
@@ -73,8 +72,9 @@ QHttpConnection::~QHttpConnection()
7372

7473
void QHttpConnection::socketDisconnected()
7574
{
76-
deleteLater();
7775
invalidateRequest();
76+
m_socket->deleteLater();
77+
deleteLater();
7878
}
7979

8080
void QHttpConnection::invalidateRequest()

0 commit comments

Comments
 (0)