diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 34ca1ae51b..5ca569fc2f 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -368,7 +368,8 @@ qemuMonitorTestFree(qemuMonitorTestPtr test) virObjectUnref(test->vm); - virThreadJoin(&test->thread); + if (test->running) + virThreadJoin(&test->thread); if (timer != -1) virEventRemoveTimeout(timer);