mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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);
|
virObjectUnref(test->vm);
|
||||||
|
|
||||||
virThreadJoin(&test->thread);
|
if (test->running)
|
||||||
|
virThreadJoin(&test->thread);
|
||||||
|
|
||||||
if (timer != -1)
|
if (timer != -1)
|
||||||
virEventRemoveTimeout(timer);
|
virEventRemoveTimeout(timer);
|
||||||
|
Loading…
Reference in New Issue
Block a user