From: Abdelrazak Younes Date: Thu, 18 Mar 2010 12:42:34 +0000 (+0000) Subject: Fix potential bug affecting export and preview with threads. X-Git-Tag: 2.0.0~3769 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=44fb52d1a2ef1133021181e9cb7db8e8121602c4;p=lyx.git Fix potential bug affecting export and preview with threads. QThreadPool::maxThreadCount() defaults in general to 2 on single or dual-processor. This is clearly not enough in a time where we use threads for document preview and/or export. 20 should be OK. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33790 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index c53331fb29..c56524fd24 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -104,6 +104,7 @@ #include #include #include +#include #include #ifdef Q_WS_X11 @@ -820,6 +821,11 @@ GuiApplication::GuiApplication(int & argc, char ** argv) connect(&d->general_timer_, SIGNAL(timeout()), this, SLOT(handleRegularEvents())); d->general_timer_.start(); + + // maxThreadCount() defaults in general to 2 on single or dual-processor. + // This is clearly not enough in a time where we use threads for + // document preview and/or export. 20 should be OK. + QThreadPool::globalInstance()->setMaxThreadCount(20); }