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:
Peter Krempa 2013-07-22 16:57:08 +02:00
parent 5bf61f3818
commit a63a7a5af9

View File

@ -368,7 +368,8 @@ qemuMonitorTestFree(qemuMonitorTestPtr test)
virObjectUnref(test->vm);
virThreadJoin(&test->thread);
if (test->running)
virThreadJoin(&test->thread);
if (timer != -1)
virEventRemoveTimeout(timer);