- 
    Bug 
- 
    Resolution: Done
- 
    P2: Important 
- 
    5.15.2, 6.1.2, 6.2.0
- 
    None
- 
        
- 
        87b93c29be (qt/qtbase/dev) d915bb8b5f (qt/qtbase/6.2) d915bb8b5f (qt/tqtc-qtbase/6.2) 87b93c29be (qt/tqtc-qtbase/dev) a00578d9aa (qt/tqtc-qtbase/5.15) 73318513b6 (qt/qtbase/6.3) 73318513b6 (qt/tqtc-qtbase/6.3)
When an application is about to be closed and all the destructors are called, if there is QtConcurrent::run on the way, it crashes as the internal threadpool pointer is nullptr.
To reproduce:
1) Start the application.
2) Close the application
-> The program has unexpectedly finished.
The crash happens in mainwindow.cpp -> QtConcurrent::run.
Form the code it is not always clear what is the reason for running a thread, so such crashes can only be avoided by this check:
    QThreadPool* threadPool = QThreadPool::globalInstance();
    if(threadPool)
        QtConcurrent::run(..);