Skip to content

Commit

Permalink
QThreadPool: make sure threads do not exit after 30 sec otherwise they
Browse files Browse the repository at this point in the history
might crash with thread local storage.
  • Loading branch information
MrKepzie committed Dec 22, 2014
1 parent 587bb69 commit 93bc45a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Engine/AppManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <QAbstractSocket>
#include <QCoreApplication>
#include <QThread>
#include <QThreadPool>
#include <QtCore/QAtomicInt>

#include "Global/MemoryInfo.h"
Expand Down Expand Up @@ -386,6 +387,8 @@ AppManager::load(int &argc,
initializeQApp(argc, argv);

_imp->idealThreadCount = QThread::idealThreadCount();
QThreadPool::globalInstance()->setExpiryTimeout(-1); //< make threads never exit on their own
//otherwise it might crash with thread local storage
_imp->diskCachesLocation = Natron::StandardPaths::writableLocation(Natron::StandardPaths::CacheLocation) ;

#if QT_VERSION < 0x050000
Expand Down

0 comments on commit 93bc45a

Please sign in to comment.