mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemumonitortestutils: Don't crash on non fully initialized test
The qemumonitorjsontest crashed when one of the initialization steps done before starting the worker thread failed. This patch fixes this by trying to pthread_join() the thread only after it was created.
This commit is contained in:
parent
5bf61f3818
commit
a63a7a5af9
@ -368,7 +368,8 @@ qemuMonitorTestFree(qemuMonitorTestPtr test)
|
||||
|
||||
virObjectUnref(test->vm);
|
||||
|
||||
virThreadJoin(&test->thread);
|
||||
if (test->running)
|
||||
virThreadJoin(&test->thread);
|
||||
|
||||
if (timer != -1)
|
||||
virEventRemoveTimeout(timer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user