mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01: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:
committed by
Norman Feske
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;
|
||||
|
||||
Reference in New Issue
Block a user