add some debug to NodeList instance refresh

This commit is contained in:
Stephen Birarda 2014-09-30 14:59:12 -07:00
parent 9950ed9f9f
commit cd9029bb92
2 changed files with 14 additions and 2 deletions

View file

@ -40,7 +40,13 @@ std::auto_ptr<LimitedNodeList> LimitedNodeList::_sharedInstance;
LimitedNodeList* LimitedNodeList::createInstance(unsigned short socketListenPort, unsigned short dtlsPort) {
NodeType::init();
delete _sharedInstance.release();
if (_sharedInstance.get()) {
qDebug() << "LimitedNodeList called with existing instance." <<
"Releasing auto_ptr, deleting existing instance and creating a new one.";
delete _sharedInstance.release();
}
_sharedInstance = std::auto_ptr<LimitedNodeList>(new LimitedNodeList(socketListenPort, dtlsPort));
// register the SharedNodePointer meta-type for signals/slots

View file

@ -28,7 +28,13 @@ NodeList* NodeList::createInstance(char ownerType, unsigned short socketListenPo
NodeType::init();
delete _sharedInstance.release();
if (_sharedInstance.get()) {
qDebug() << "NodeList called with existing instance." <<
"Releasing auto_ptr, deleting existing instance and creating a new one.";
delete _sharedInstance.release();
}
_sharedInstance = std::auto_ptr<LimitedNodeList>(new NodeList(ownerType, socketListenPort, dtlsPort));
// register the SharedNodePointer meta-type for signals/slots