Merge branch 'master' of github.com:highfidelity/hifi into smaller-collision-margins

This commit is contained in:
Seth Alves 2015-05-13 13:56:29 -07:00
commit 3f8f5fd82e
6 changed files with 229 additions and 224 deletions

View file

@ -232,9 +232,11 @@ void AssignmentClient::readPendingDatagrams() {
connect(workerThread, &QThread::started, _currentAssignment.data(), &ThreadedAssignment::run); connect(workerThread, &QThread::started, _currentAssignment.data(), &ThreadedAssignment::run);
// once the ThreadedAssignment says it is finished - we ask it to deleteLater // Once the ThreadedAssignment says it is finished - we ask it to deleteLater
// This is a queued connection so that it is put into the event loop to be processed by the worker
// thread when it is ready.
connect(_currentAssignment.data(), &ThreadedAssignment::finished, _currentAssignment.data(), connect(_currentAssignment.data(), &ThreadedAssignment::finished, _currentAssignment.data(),
&ThreadedAssignment::deleteLater); &ThreadedAssignment::deleteLater, Qt::QueuedConnection);
// once it is deleted, we quit the worker thread // once it is deleted, we quit the worker thread
connect(_currentAssignment.data(), &ThreadedAssignment::destroyed, workerThread, &QThread::quit); connect(_currentAssignment.data(), &ThreadedAssignment::destroyed, workerThread, &QThread::quit);

View file

@ -29,6 +29,8 @@ class AudioMixer : public ThreadedAssignment {
Q_OBJECT Q_OBJECT
public: public:
AudioMixer(const QByteArray& packet); AudioMixer(const QByteArray& packet);
void deleteLater() { qDebug() << "DELETE LATER CALLED?"; QObject::deleteLater(); }
public slots: public slots:
/// threaded run of assignment /// threaded run of assignment
void run(); void run();

View file

@ -53,6 +53,7 @@ void ThreadedAssignment::setFinished(bool isFinished) {
// if we have a datagram processing thread, quit it and wait on it to make sure that // if we have a datagram processing thread, quit it and wait on it to make sure that
// the node socket is back on the same thread as the NodeList // the node socket is back on the same thread as the NodeList
if (_datagramProcessingThread) { if (_datagramProcessingThread) {
// tell the datagram processing thread to quit and wait until it is done, // tell the datagram processing thread to quit and wait until it is done,
// then return the node socket to the NodeList // then return the node socket to the NodeList