mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
include/qapi: add g_autoptr support for qobject types
Need wrappers for qobject_unref() calls, which is a macro. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323155743.1585078-10-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
7773e13fa7
commit
d709bbf3b1
12 changed files with 54 additions and 0 deletions
|
@ -56,3 +56,8 @@ void qbool_destroy_obj(QObject *obj)
|
|||
assert(obj != NULL);
|
||||
g_free(qobject_to(QBool, obj));
|
||||
}
|
||||
|
||||
void qbool_unref(QBool *q)
|
||||
{
|
||||
qobject_unref(q);
|
||||
}
|
||||
|
|
|
@ -442,3 +442,8 @@ void qdict_destroy_obj(QObject *obj)
|
|||
|
||||
g_free(qdict);
|
||||
}
|
||||
|
||||
void qdict_unref(QDict *q)
|
||||
{
|
||||
qobject_unref(q);
|
||||
}
|
||||
|
|
|
@ -182,3 +182,8 @@ void qlist_destroy_obj(QObject *obj)
|
|||
|
||||
g_free(qlist);
|
||||
}
|
||||
|
||||
void qlist_unref(QList *q)
|
||||
{
|
||||
qobject_unref(q);
|
||||
}
|
||||
|
|
|
@ -29,3 +29,8 @@ bool qnull_is_equal(const QObject *x, const QObject *y)
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void qnull_unref(QNull *q)
|
||||
{
|
||||
qobject_unref(q);
|
||||
}
|
||||
|
|
|
@ -239,3 +239,8 @@ void qnum_destroy_obj(QObject *obj)
|
|||
assert(obj != NULL);
|
||||
g_free(qobject_to(QNum, obj));
|
||||
}
|
||||
|
||||
void qnum_unref(QNum *q)
|
||||
{
|
||||
qobject_unref(q);
|
||||
}
|
||||
|
|
|
@ -100,3 +100,8 @@ void qstring_destroy_obj(QObject *obj)
|
|||
g_free((char *)qs->string);
|
||||
g_free(qs);
|
||||
}
|
||||
|
||||
void qstring_unref(QString *q)
|
||||
{
|
||||
qobject_unref(q);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue