Showing the changes to libraries/shared/src/GenericThread.cpp (1 of 18 files). Show all
Unified · Split
| @@ -46,6 +46,8 @@ void GenericThread::initialize(bool isThreaded, QThread::Priority priority) { · 45 unmodified lines | |||
| 46 | _thread->start(); | 46 | _thread->start(); |
| 47 | 47 | ||
| 48 | _thread->setPriority(priority); | 48 | _thread->setPriority(priority); |
| 49 | } else { | ||
| 50 | setup(); | ||
| 49 | } | 51 | } |
| 50 | } | 52 | } |
| 51 | 53 | ||
| @@ -60,10 +62,16 @@ void GenericThread::terminate() { · 8 unmodified lines | |||
| 60 | _thread->deleteLater(); | 62 | _thread->deleteLater(); |
| 61 | _thread = NULL; | 63 | _thread = NULL; |
| 62 | } | 64 | } |
| 65 | } else { | ||
| 66 | shutdown(); | ||
| 63 | } | 67 | } |
| 64 | } | 68 | } |
| 65 | 69 | ||
| 66 | void GenericThread::threadRoutine() { | 70 | void GenericThread::threadRoutine() { |
| 71 | if (_isThreaded) { | ||
| 72 | setup(); | ||
| 73 | } | ||
| 74 | |||
| 67 | while (!_stopThread) { | 75 | while (!_stopThread) { |
| 68 | 76 | ||
| 69 | // override this function to do whatever your class actually does, return false to exit thread early | 77 | // override this function to do whatever your class actually does, return false to exit thread early |
| @@ -78,8 +86,13 @@ void GenericThread::threadRoutine() { · 8 unmodified lines | |||
| 78 | } | 86 | } |
| 79 | } | 87 | } |
| 80 | 88 | ||
| 81 | // If we were on a thread, then quit our thread | 89 | if (_isThreaded) { |
| 82 | if (_isThreaded && _thread) { | 90 | shutdown(); |
| 83 | _thread->quit(); | 91 | |
| 92 | // If we were on a thread, then quit our thread | ||
| 93 | if (_thread) { | ||
| 94 | _thread->quit(); | ||
| 95 | } | ||
| 84 | } | 96 | } |
| 97 | |||
| 85 | } | 98 | } |