mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-04 10:54:35 +00:00
Fixed memory leak in HTTP server
This commit is contained in:
parent
918c1507d3
commit
e21c28e9d2
@ -46,13 +46,14 @@ HttpServer::HttpServer(bittorrent *BTSession, int msec, QObject* parent) : QTcpS
|
||||
connect(BTSession, SIGNAL(addedTorrent(QTorrentHandle&)), manager, SLOT(addedTorrent(QTorrentHandle&)));
|
||||
connect(BTSession, SIGNAL(deletedTorrent(QString)), manager, SLOT(deletedTorrent(QString)));
|
||||
//set timer
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer = new QTimer(this);
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(onTimer()));
|
||||
timer->start(msec);
|
||||
}
|
||||
|
||||
HttpServer::~HttpServer()
|
||||
{
|
||||
delete timer;
|
||||
delete manager;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <QByteArray>
|
||||
|
||||
class bittorrent;
|
||||
|
||||
class QTimer;
|
||||
class EventManager;
|
||||
|
||||
class HttpServer : public QTcpServer
|
||||
@ -37,6 +37,7 @@ class HttpServer : public QTcpServer
|
||||
QByteArray base64;
|
||||
bittorrent *BTSession;
|
||||
EventManager *manager;
|
||||
QTimer *timer;
|
||||
|
||||
public:
|
||||
HttpServer(bittorrent *BTSession, int msec, QObject* parent = 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user