[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] qapi: define cleanup function for g_autoptr(Error)
From: |
Paolo Bonzini |
Subject: |
[PATCH] qapi: define cleanup function for g_autoptr(Error) |
Date: |
Sun, 12 Sep 2021 14:48:34 +0200 |
Allow replacing calls to error_free() with g_autoptr(Error)
declarations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/qapi/error.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/qapi/error.h b/include/qapi/error.h
index 4a9260b0cc..8564657baf 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -437,6 +437,8 @@ Error *error_copy(const Error *err);
*/
void error_free(Error *err);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(Error, error_free);
+
/*
* Convenience function to assert that *@errp is set, then silently free it.
*/
--
2.31.1
- [PATCH] qapi: define cleanup function for g_autoptr(Error),
Paolo Bonzini <=
- Re: [PATCH] qapi: define cleanup function for g_autoptr(Error), Richard Henderson, 2021/09/12
- Re: [PATCH] qapi: define cleanup function for g_autoptr(Error), Markus Armbruster, 2021/09/13
- Re: [PATCH] qapi: define cleanup function for g_autoptr(Error), Paolo Bonzini, 2021/09/13
- Re: [PATCH] qapi: define cleanup function for g_autoptr(Error), Daniel P . Berrangé, 2021/09/13
- Re: [PATCH] qapi: define cleanup function for g_autoptr(Error), Markus Armbruster, 2021/09/13
- Re: [PATCH] qapi: define cleanup function for g_autoptr(Error), Markus Armbruster, 2021/09/13
- Re: [PATCH] qapi: define cleanup function for g_autoptr(Error), Philippe Mathieu-Daudé, 2021/09/13
- Re: [PATCH] qapi: define cleanup function for g_autoptr(Error), Markus Armbruster, 2021/09/14