Merge pull request #5936 from birarda/tv-es-lockup

fix a timer leak, line width in PacketList
This commit is contained in:
Brad Hefta-Gaub 2015-10-01 14:39:40 -07:00
commit f2e65f5a98
2 changed files with 5 additions and 3 deletions

View file

@ -49,7 +49,8 @@ void ThreadedAssignment::setFinished(bool isFinished) {
}
if (_statsTimer) {
_statsTimer->stop();
_statsTimer->deleteLater();
_statsTimer = nullptr;
}
// call our virtual aboutToFinish method - this gives the ThreadedAssignment subclass a chance to cleanup
@ -105,7 +106,7 @@ void ThreadedAssignment::sendStatsPacket() {
void ThreadedAssignment::startSendingStats() {
// send the stats packet every 1s
if (!_statsTimer) {
_statsTimer = new QTimer();
_statsTimer = new QTimer;
connect(_statsTimer, &QTimer::timeout, this, &ThreadedAssignment::sendStatsPacket);
}

View file

@ -28,7 +28,8 @@ class Packet;
class PacketList : public QIODevice {
Q_OBJECT
public:
static std::unique_ptr<PacketList> create(PacketType packetType, QByteArray extendedHeader = QByteArray(), bool isReliable = false, bool isOrdered = false);
static std::unique_ptr<PacketList> create(PacketType packetType, QByteArray extendedHeader = QByteArray(),
bool isReliable = false, bool isOrdered = false);
static std::unique_ptr<PacketList> fromReceivedPackets(std::list<std::unique_ptr<Packet>>&& packets);
bool isReliable() const { return _isReliable; }