mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 23:33:26 +02:00
Remove OctreeServer's static instance
This commit is contained in:
parent
09701fdcf1
commit
346c28f9e2
3 changed files with 3 additions and 16 deletions
|
@ -28,7 +28,6 @@
|
|||
#include "OctreeQueryNode.h"
|
||||
#include "OctreeServerConsts.h"
|
||||
|
||||
OctreeServer* OctreeServer::_instance = NULL;
|
||||
int OctreeServer::_clientCount = 0;
|
||||
const int MOVING_AVERAGE_SAMPLE_COUNTS = 1000000;
|
||||
|
||||
|
@ -232,13 +231,6 @@ OctreeServer::OctreeServer(ReceivedMessage& message) :
|
|||
_started(time(0)),
|
||||
_startedUSecs(usecTimestampNow())
|
||||
{
|
||||
if (_instance) {
|
||||
qDebug() << "Octree Server starting... while old instance still running _instance=["<<_instance<<"] this=[" << this << "]";
|
||||
}
|
||||
|
||||
qDebug() << "Octree Server starting... setting _instance to=[" << this << "]";
|
||||
_instance = this;
|
||||
|
||||
_averageLoopTime.updateAverage(0);
|
||||
qDebug() << "Octree server starting... [" << this << "]";
|
||||
|
||||
|
@ -282,9 +274,6 @@ OctreeServer::~OctreeServer() {
|
|||
_tree.reset();
|
||||
qDebug() << qPrintable(_safeServerName) << "server DONE cleaning up octree... [" << this << "]";
|
||||
|
||||
if (_instance == this) {
|
||||
_instance = NULL; // we are gone
|
||||
}
|
||||
qDebug() << qPrintable(_safeServerName) << "server DONE shutting down... [" << this << "]";
|
||||
}
|
||||
|
||||
|
@ -1118,8 +1107,8 @@ void OctreeServer::domainSettingsRequestComplete() {
|
|||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
#endif
|
||||
|
||||
nodeList->linkedDataCreateCallback = [] (Node* node) {
|
||||
auto queryNodeData = _instance->createOctreeQueryNode();
|
||||
nodeList->linkedDataCreateCallback = [this](Node* node) {
|
||||
auto queryNodeData = createOctreeQueryNode();
|
||||
queryNodeData->init();
|
||||
node->setLinkedData(std::move(queryNodeData));
|
||||
};
|
||||
|
|
|
@ -187,8 +187,6 @@ protected:
|
|||
int _backupInterval;
|
||||
int _maxBackupVersions;
|
||||
|
||||
static OctreeServer* _instance;
|
||||
|
||||
time_t _started;
|
||||
quint64 _startedUSecs;
|
||||
QString _safeServerName;
|
||||
|
|
|
@ -129,7 +129,7 @@ public:
|
|||
qint64 sendPacketList(std::unique_ptr<NLPacketList> packetList, const HifiSockAddr& sockAddr);
|
||||
qint64 sendPacketList(std::unique_ptr<NLPacketList> packetList, const Node& destinationNode);
|
||||
|
||||
void (*linkedDataCreateCallback)(Node *);
|
||||
std::function<void(Node*)> linkedDataCreateCallback;
|
||||
|
||||
size_t size() const { return _nodeHash.size(); }
|
||||
|
||||
|
|
Loading…
Reference in a new issue