QThread attempts to lock something when it exits using a QMutexLocker class.

Qt Code:
  1. void QThread::exit(int returnCode)
  2. {
  3. Q_D(QThread);
  4. QMutexLocker locker(&d->mutex); // <------ Crashes here! d == 0x0
  5. d->data->quitNow = true;
  6. for (int i = 0; i < d->data->eventLoops.size(); ++i) {
  7. QEventLoop *eventLoop = d->data->eventLoops.at(i);
  8. eventLoop->exit(returnCode);
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 

Just trying to declare the QMutexLocker causes a crash.

This looks like a Qt bug, but I'm not sure.

Any ideas? It looks like "d" might not have been allocated.