From d709bbf3b17f43c91e82c3807a39f2c349d27934 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Wed, 23 Mar 2022 19:57:20 +0400 Subject: 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 Reviewed-by: Markus Armbruster Reviewed-by: Richard Henderson Message-Id: <20220323155743.1585078-10-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qapi/qmp/qnull.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/qapi/qmp/qnull.h') diff --git a/include/qapi/qmp/qnull.h b/include/qapi/qmp/qnull.h index e84ecceedb..7feb7c7d83 100644 --- a/include/qapi/qmp/qnull.h +++ b/include/qapi/qmp/qnull.h @@ -26,4 +26,8 @@ static inline QNull *qnull(void) return qobject_ref(&qnull_); } +void qnull_unref(QNull *q); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QNull, qnull_unref) + #endif /* QNULL_H */ -- cgit v1.2.3-55-g7522