Skip to content

Commit

Permalink
Fix potential memory leak due to QNetworkReply may not deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
timonwong committed May 8, 2013
1 parent abf027a commit 8a46cd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions webmultimediadownload.cc
Expand Up @@ -21,7 +21,7 @@ void WebMultimediaDownload::cancel()

void WebMultimediaDownload::replyFinished( QNetworkReply * r )
{
if ( r != reply )
if ( !r || r != reply )
return; // Not our reply

if ( r->error() == QNetworkReply::NoError )
Expand All @@ -39,9 +39,10 @@ void WebMultimediaDownload::replyFinished( QNetworkReply * r )
else
setErrorString( r->errorString() );

finish();

r->deleteLater();
reply = NULL;

finish();
}

bool WebMultimediaDownload::isAudioUrl( QUrl const & url )
Expand Down

0 comments on commit 8a46cd8

Please sign in to comment.