This commit is contained in:
Seth Alves 2015-04-29 15:30:13 -07:00
parent 009bb9dc71
commit e985f56b12
11 changed files with 3 additions and 47 deletions

View file

@ -117,18 +117,14 @@ void AssignmentClient::stopAssignmentClient() {
if (_currentAssignment) {
_currentAssignment->aboutToQuit();
QThread* currentAssignmentThread = _currentAssignment->thread();
qDebug() << "main thread waiting on _currentAssignment->thread()" << currentAssignmentThread->objectName();
currentAssignmentThread->quit();
currentAssignmentThread->wait();
qDebug() << "done waiting.";
}
}
void AssignmentClient::aboutToQuit() {
qDebug() << "AssignmentClient::aboutToQuit start";
stopAssignmentClient();
qDebug() << "AssignmentClient::aboutToQuit end";
// clear the log handler so that Qt doesn't call the destructor on LogHandler
qInstallMessageHandler(0);
// clear out pointer to the assignment so the destructor gets called. if we don't do this here,

View file

@ -167,6 +167,7 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) :
}
if (parser.isSet(numChildsOption)) {
if (minForks && minForks > numForks) {
qCritical() << "--min can't be more than -n";

View file

@ -74,7 +74,6 @@ public:
NodeToSenderStatsMap& getSingleSenderStats() { return _singleSenderStats; }
// void shuttingDown() { _shuttingDown = true;}
virtual void terminating() { _shuttingDown = true; ReceivedPacketProcessor::terminating(); }
protected:

View file

@ -239,10 +239,8 @@ OctreeServer::OctreeServer(const QByteArray& packet) :
_octreeInboundPacketProcessor(NULL),
_persistThread(NULL),
_started(time(0)),
_startedUSecs(usecTimestampNow()),
_nodeList(DependencyManager::get<NodeList>())
_startedUSecs(usecTimestampNow())
{
if (_instance) {
qDebug() << "Octree Server starting... while old instance still running _instance=["<<_instance<<"] this=[" << this << "]";
}
@ -1100,8 +1098,6 @@ void OctreeServer::readConfiguration() {
}
void OctreeServer::run() {
// qInstallMessageHandler(LogHandler::verboseMessageHandler);
_safeServerName = getMyServerName();
// Before we do anything else, create our tree...

View file

@ -238,9 +238,6 @@ protected:
static QMutex _threadsDidPacketDistributorMutex;
static QMutex _threadsDidHandlePacketSendMutex;
static QMutex _threadsDidCallWriteDatagramMutex;
// keep a pointer to node list so that it doesn't get shut down before this class.
QSharedPointer<NodeList> _nodeList;
};
#endif // hifi_OctreeServer_h

View file

@ -221,10 +221,6 @@ protected:
LimitedNodeList(unsigned short socketListenPort = 0, unsigned short dtlsListenPort = 0);
LimitedNodeList(LimitedNodeList const&); // Don't implement, needed to avoid copies of singleton
void operator=(LimitedNodeList const&); // Don't implement, needed to avoid copies of singleton
virtual ~LimitedNodeList() {
qDebug() << "XXXXXXXXXXXXXXXXXXXX ~LimitedNodeList called";
}
qint64 writeDatagram(const QByteArray& datagram, const HifiSockAddr& destinationSockAddr,
const QUuid& connectionSecret);

View file

@ -45,11 +45,6 @@ class NodeList : public LimitedNodeList {
SINGLETON_DEPENDENCY
public:
virtual ~NodeList() {
qDebug() << "XXXXXXXXXXXXXXXXXXXX ~NodeList called";
}
NodeType_t getOwnerType() const { return _ownerType; }
void setOwnerType(NodeType_t ownerType) { _ownerType = ownerType; }

View file

@ -26,14 +26,7 @@ ThreadedAssignment::ThreadedAssignment(const QByteArray& packet) :
}
ThreadedAssignment::~ThreadedAssignment() {
// setFinished(true);
}
void ThreadedAssignment::setFinished(bool isFinished) {
qDebug() << "------------- ThreadedAssignment::setFinished" << isFinished << " -------------------";
_isFinished = isFinished;
if (_isFinished) {
@ -57,10 +50,8 @@ void ThreadedAssignment::setFinished(bool isFinished) {
if (_datagramProcessingThread) {
// tell the datagram processing thread to quit and wait until it is done, then return the node socket to the NodeList
qDebug() << "stopping datagramProcessingThread...";
_datagramProcessingThread->quit();
_datagramProcessingThread->wait();
qDebug() << "done stopping datagramProcessingThread.";
// set node socket parent back to NodeList
nodeList->getNodeSocket().setParent(nodeList.data());

View file

@ -20,7 +20,6 @@ class ThreadedAssignment : public Assignment {
Q_OBJECT
public:
ThreadedAssignment(const QByteArray& packet);
virtual ~ThreadedAssignment();
void setFinished(bool isFinished);
virtual void aboutToFinish() { };

View file

@ -26,12 +26,9 @@
class Dependency {
public:
typedef std::function<void(Dependency* pointer)> DeleterFunction;
const QString& getDependencyName() { return _name; }
protected:
virtual ~Dependency() {
qDebug() << "DESTRUCTING" << _name;
}
virtual ~Dependency() {}
virtual void customDeleter() {
_customDeleter(this);
}
@ -39,9 +36,6 @@ protected:
void setCustomDeleter(DeleterFunction customDeleter) { _customDeleter = customDeleter; }
DeleterFunction _customDeleter = [](Dependency* pointer) { delete pointer; };
void setDependencyName(QString name) { _name = name; }
QString _name;
friend class DependencyManager;
};
@ -101,7 +95,6 @@ QSharedPointer<T> DependencyManager::set(Args&&... args) {
QSharedPointer<T> newInstance(new T(args...), &T::customDeleter);
QSharedPointer<Dependency> storedInstance = qSharedPointerCast<Dependency>(newInstance);
instance.swap(storedInstance);
newInstance->setDependencyName(typeid(T).name());
return newInstance;
}
@ -109,7 +102,6 @@ QSharedPointer<T> DependencyManager::set(Args&&... args) {
template <typename T>
void DependencyManager::destroy() {
static size_t hashCode = _manager.getHashCode<T>();
qDebug() << "DESTROYING" << _manager.safeGet(hashCode)->getDependencyName();
_manager.safeGet(hashCode).clear();
}

View file

@ -19,8 +19,6 @@
#include <qset.h>
#include <qstring.h>
#include <iostream>
const int VERBOSE_LOG_INTERVAL_SECONDS = 5;
enum LogMsgType {
@ -36,10 +34,6 @@ class LogHandler : public QObject {
Q_OBJECT
public:
static LogHandler& getInstance();
virtual ~LogHandler() {
std::cerr << "XXXXXXXX ~LogHandler()\n";
}
/// sets the target name to output via the verboseMessageHandler, called once before logging begins
/// \param targetName the desired target name to output in logs