Fix warnings about creating QObjects with parents in different thread

This commit is contained in:
Brad Davis 2017-06-23 10:19:16 -07:00
parent 63279f4525
commit 416852c0cd
3 changed files with 10 additions and 6 deletions
interface/src
libraries/gpu-gl/src/gpu/gl

View file

@ -713,9 +713,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
updateHeartbeat();
// setup a timer for domain-server check ins
QTimer* domainCheckInTimer = new QTimer(nodeList.data());
QTimer* domainCheckInTimer = new QTimer(this);
connect(domainCheckInTimer, &QTimer::timeout, nodeList.data(), &NodeList::sendDomainServerCheckIn);
domainCheckInTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS);
connect(this, &QCoreApplication::aboutToQuit, [domainCheckInTimer] {
domainCheckInTimer->stop();
domainCheckInTimer->deleteLater();
});
auto audioIO = DependencyManager::get<AudioClient>();

View file

@ -178,6 +178,11 @@ void GLBackend::init() {
int swapInterval = wglGetSwapIntervalEXT();
qCDebug(gpugllogging, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
}*/
#endif
#if THREADED_TEXTURE_BUFFERING
// This has to happen on the main thread in order to give the thread
// pool a reasonable parent object
GLVariableAllocationSupport::TransferJob::startBufferingThread();
#endif
});
}

View file

@ -461,11 +461,6 @@ void GLVariableAllocationSupport::updateMemoryPressure() {
if (newState != _memoryPressureState) {
_memoryPressureState = newState;
#if THREADED_TEXTURE_BUFFERING
if (MemoryPressureState::Transfer == _memoryPressureState) {
TransferJob::startBufferingThread();
}
#endif
// Clear the existing queue
_transferQueue = WorkQueue();
_promoteQueue = WorkQueue();