Skip to content

Commit

Permalink
Revert "Revert "Prevent multiple instances of the same DownloadInfo p…
Browse files Browse the repository at this point in the history
…ointer being added to the cancellation queue""

This reverts commit e715acc.
  • Loading branch information
jyavenard committed Aug 12, 2013
1 parent fd132e6 commit ea2e3c8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mythtv/libs/libmythbase/mythdownloadmanager.cpp
Expand Up @@ -873,18 +873,22 @@ void MythDownloadManager::cancelDownload(const QString &url)
dlInfo = lit.value();
if (dlInfo->m_url == url)
{
m_cancellationQueue.append(dlInfo);
if (!m_cancellationQueue.contains(dlInfo))
m_cancellationQueue.append(dlInfo);
lit.remove();
}
}

if (m_downloadInfos.contains(url))
{
dlInfo = m_downloadInfos[url];

if (!m_cancellationQueue.contains(dlInfo))
m_cancellationQueue.append(dlInfo);

if (dlInfo->m_reply)
m_downloadReplies.remove(dlInfo->m_reply);

m_cancellationQueue.append(dlInfo);
m_downloadInfos.remove(url);
}

Expand All @@ -902,7 +906,7 @@ void MythDownloadManager::downloadCanceled()
{
lit.next();
dlInfo = lit.value();
// this shouldn't happen

if (dlInfo->m_reply)
{
LOG(VB_FILE, LOG_DEBUG,
Expand Down

0 comments on commit ea2e3c8

Please sign in to comment.