Changeset 73469 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 3, 2018 12:04:15 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
r71454 r73469 116 116 , m_fShutdown(false) 117 117 { 118 setObjectName("UIMainEventListeningThread"); 118 119 } 119 120 … … 123 124 setShutdown(true); 124 125 125 /* And wait 30 seconds for run() to finish: */ 126 wait(30000); 126 /* And wait 30 seconds for run() to finish (1 sec increments to help with 127 delays incurred debugging and prevent suicidal use-after-free behaviour): */ 128 uint32_t i = 30000; 129 do 130 wait(1000); 131 while (i-- > 0 && !isFinished()); 127 132 } 128 133 … … 204 209 { 205 210 /* Wipe out the threads: */ 211 /** @todo r=bird: The use of qDeleteAll here is unsafe because it won't take 212 * QThread::wait() timeouts into account, and may delete the QThread object 213 * while the thread is still running, causing heap corruption/crashes once 214 * the thread awakens and gets on with its termination. 215 * Observed with debugger + paged heap. 216 * 217 * Should use specialized thread list which only deletes the threads after 218 * isFinished() returns true, leaving them alone on timeout failures. */ 206 219 qDeleteAll(m_threads); 207 220 }
Note:
See TracChangeset
for help on using the changeset viewer.