Merge pull request #4856 from birarda/master

fix for audio-mixer ignore of deleteLater
This commit is contained in:
Seth Alves 2015-05-13 12:36:58 -07:00
commit 8102e534dd
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);
// 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(),
&ThreadedAssignment::deleteLater);
&ThreadedAssignment::deleteLater, Qt::QueuedConnection);
// once it is deleted, we quit the worker thread
connect(_currentAssignment.data(), &ThreadedAssignment::destroyed, workerThread, &QThread::quit);

View file

@ -29,6 +29,8 @@ class AudioMixer : public ThreadedAssignment {
Q_OBJECT
public:
AudioMixer(const QByteArray& packet);
void deleteLater() { qDebug() << "DELETE LATER CALLED?"; QObject::deleteLater(); }
public slots:
/// threaded run of assignment
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
// the node socket is back on the same thread as the NodeList
if (_datagramProcessingThread) {
// tell the datagram processing thread to quit and wait until it is done,
// then return the node socket to the NodeList