1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-02 18:04:32 +00:00

Fix a memleak in torrentmodel.

Perhaps we should finally move to C++11 and std::unique_ptr?
This commit is contained in:
Ivan Sorokin 2014-11-02 14:54:10 +03:00
parent 9b71e4ffc9
commit 807960b768

View File

@ -408,6 +408,7 @@ void TorrentModel::removeTorrent(const QString &hash)
qDebug() << Q_FUNC_INFO << hash << row; qDebug() << Q_FUNC_INFO << hash << row;
if (row >= 0) { if (row >= 0) {
beginRemoveTorrent(row); beginRemoveTorrent(row);
delete m_torrents[row];
m_torrents.removeAt(row); m_torrents.removeAt(row);
endRemoveTorrent(); endRemoveTorrent();
} }