mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 16:13:28 +02:00
fix a timer leak, line width in PacketList
This commit is contained in:
parent
2976520061
commit
f4bc3f8e38
2 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue