提交 3cd556d4 编写于 作者: C Cédric Bosdonnat

lxc: monitor now holds a reference to the domain

If the monitor doesn't hold a reference to the domain object
the object may be destroyed before the monitor actually stops.
上级 ce937d37
......@@ -175,7 +175,7 @@ virLXCMonitorPtr virLXCMonitorNew(virDomainObjPtr vm,
mon->program) < 0)
goto error;
mon->vm = vm;
mon->vm = virObjectRef(vm);
memcpy(&mon->cb, cb, sizeof(mon->cb));
virObjectRef(mon);
......@@ -201,6 +201,7 @@ static void virLXCMonitorDispose(void *opaque)
if (mon->cb.destroy)
(mon->cb.destroy)(mon, mon->vm);
virObjectUnref(mon->program);
virObjectUnref(mon->vm);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册