mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
Seed Qt's random generator
LyX uses QTemporaryFile to create a unique temporary directory. This temporary directory will consist of two random characters and the process identifier (PID). Currently, the two random characters are often the same because Qt's random generator was not seeded. If there are a lot of lyx temporary directories accumulated, the chance of failing to find a unique temporary directory is (N/100)%. The temporary directories can be left behind if either LyX crashes, or when a file in the temporary directory is opened in another viewer when LyX closes. This can be a pdf that is viewed in a reader that disallows the file to be removed while viewing it.
This commit is contained in:
parent
30f5187070
commit
327f7ed90d
@ -946,6 +946,8 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
|
||||
QCoreApplication::setOrganizationDomain("lyx.org");
|
||||
QCoreApplication::setApplicationName(lyx_package);
|
||||
|
||||
qsrand(QDateTime::currentDateTime().toTime_t());
|
||||
|
||||
// Install translator for GUI elements.
|
||||
installTranslator(&d->qt_trans_);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user