mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
qt5: destroy finished thread in 'QThread::start()'
A 'QThread' can be reused when its execution is finished by calling 'QThread::start()' again. Before this commit, this created a new Genode thread, but did not destroy a previously finished Genode thread first. Fixes #2928
This commit is contained in:
parent
007a977cb0
commit
0d7dec0436
@ -659,6 +659,19 @@ void QThread::start(Priority priority)
|
||||
if (d->running)
|
||||
return;
|
||||
|
||||
#ifdef Q_OS_GENODE
|
||||
if (d->finished) {
|
||||
/**
|
||||
* Thread is to be restarted.
|
||||
*
|
||||
* Since a new Genode thread is going to be created below, the old one
|
||||
* needs to be destroyed first.
|
||||
*/
|
||||
delete d->genode_thread;
|
||||
d->genode_thread = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
d->running = true;
|
||||
d->finished = false;
|
||||
d->returnCode = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user