mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qmp-output-visitor: Favor new visit_free() function
Now that we have a polymorphic visit_free(), we no longer need qmp_output_visitor_cleanup(); however, we still need to expose the subtype for qmp_output_get_qobject(). Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1465490926-28625-10-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
e7ca565629
commit
1830f22a67
10 changed files with 14 additions and 21 deletions
|
@ -217,21 +217,15 @@ Visitor *qmp_output_get_visitor(QmpOutputVisitor *v)
|
|||
static void qmp_output_free(Visitor *v)
|
||||
{
|
||||
QmpOutputVisitor *qov = to_qov(v);
|
||||
|
||||
qmp_output_visitor_cleanup(qov);
|
||||
}
|
||||
|
||||
void qmp_output_visitor_cleanup(QmpOutputVisitor *v)
|
||||
{
|
||||
QStackEntry *e, *tmp;
|
||||
|
||||
QTAILQ_FOREACH_SAFE(e, &v->stack, node, tmp) {
|
||||
QTAILQ_REMOVE(&v->stack, e, node);
|
||||
QTAILQ_FOREACH_SAFE(e, &qov->stack, node, tmp) {
|
||||
QTAILQ_REMOVE(&qov->stack, e, node);
|
||||
g_free(e);
|
||||
}
|
||||
|
||||
qobject_decref(v->root);
|
||||
g_free(v);
|
||||
qobject_decref(qov->root);
|
||||
g_free(qov);
|
||||
}
|
||||
|
||||
QmpOutputVisitor *qmp_output_visitor_new(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue