mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 10:13:22 +02:00
Merge pull request #10690 from Atlante45/fix/node-leak
Fix for Jurisdiction listener
This commit is contained in:
commit
57cd819307
4 changed files with 5 additions and 6 deletions
assignment-client/src/octree
libraries
|
@ -47,7 +47,7 @@ void OctreeInboundPacketProcessor::resetStats() {
|
|||
_singleSenderStats.clear();
|
||||
}
|
||||
|
||||
unsigned long OctreeInboundPacketProcessor::getMaxWait() const {
|
||||
uint32_t OctreeInboundPacketProcessor::getMaxWait() const {
|
||||
// calculate time until next sendNackPackets()
|
||||
quint64 nextNackTime = _lastNackTime + TOO_LONG_SINCE_LAST_NACK;
|
||||
quint64 now = usecTimestampNow();
|
||||
|
|
|
@ -80,7 +80,7 @@ protected:
|
|||
|
||||
virtual void processPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) override;
|
||||
|
||||
virtual unsigned long getMaxWait() const override;
|
||||
virtual uint32_t getMaxWait() const override;
|
||||
virtual void preProcess() override;
|
||||
virtual void midProcess() override;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
class ReceivedPacketProcessor : public GenericThread {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static const unsigned long MAX_WAIT_TIME { 100 };
|
||||
static const uint64_t MAX_WAIT_TIME { 100 }; // Max wait time in ms
|
||||
|
||||
ReceivedPacketProcessor();
|
||||
|
||||
|
@ -66,7 +66,7 @@ protected:
|
|||
virtual bool process() override;
|
||||
|
||||
/// Determines the timeout of the wait when there are no packets to process. Default value is 100ms to allow for regular event processing.
|
||||
virtual unsigned long getMaxWait() const { return MAX_WAIT_TIME; }
|
||||
virtual uint32_t getMaxWait() const { return MAX_WAIT_TIME; }
|
||||
|
||||
/// Override to do work before the packets processing loop. Default does nothing.
|
||||
virtual void preProcess() { }
|
||||
|
|
|
@ -35,14 +35,13 @@ void JurisdictionListener::nodeKilled(SharedNodePointer node) {
|
|||
}
|
||||
|
||||
bool JurisdictionListener::queueJurisdictionRequest() {
|
||||
auto packet = NLPacket::create(PacketType::JurisdictionRequest, 0);
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
int nodeCount = 0;
|
||||
|
||||
nodeList->eachNode([&](const SharedNodePointer& node) {
|
||||
if (node->getType() == getNodeType() && node->getActiveSocket()) {
|
||||
auto packet = NLPacket::create(PacketType::JurisdictionRequest, 0);
|
||||
_packetSender.queuePacketForSending(node, std::move(packet));
|
||||
nodeCount++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue