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

Fixed memory leak in QHttpConnection class #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/qhttpconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ QHttpConnection::~QHttpConnection()

delete m_parserSettings;
m_parserSettings = 0;

delete m_request;
m_request = 0;
}

void QHttpConnection::socketDisconnected()
Expand Down Expand Up @@ -229,6 +232,7 @@ int QHttpConnection::HeadersComplete(http_parser *parser)

connect(theConnection, SIGNAL(destroyed()), response, SLOT(connectionClosed()));
connect(response, SIGNAL(done()), theConnection, SLOT(responseDone()));
connect(theConnection, SIGNAL(destroyed()), theConnection->m_request, SLOT(deleteLater()));

// we are good to go!
Q_EMIT theConnection->newRequest(theConnection->m_request, response);
Expand Down