qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] qom/object: Comment to use g_slist_free on object_class_get_list


From: Philippe Mathieu-Daudé
Subject: [PATCH] qom/object: Comment to use g_slist_free on object_class_get_list result
Date: Thu, 27 Feb 2020 20:09:42 +0100

Document the list returned by object_class_get_list() must be
released with g_slist_free() to avoid memory leaks.

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
 include/qom/object.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/qom/object.h b/include/qom/object.h
index 29546496c1..5517b56508 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -984,6 +984,9 @@ void object_class_foreach(void (*fn)(ObjectClass *klass, 
void *opaque),
  * @include_abstract: Whether to include abstract classes.
  *
  * Returns: A singly-linked list of the classes in reverse hashtable order.
+ *
+ * The returned list must be released with g_slist_free()
+ * when no longer required.
  */
 GSList *object_class_get_list(const char *implements_type,
                               bool include_abstract);
@@ -995,6 +998,9 @@ GSList *object_class_get_list(const char *implements_type,
  *
  * Returns: A singly-linked list of the classes in alphabetical
  * case-insensitive order.
+ *
+ * The returned list must be released with g_slist_free()
+ * when no longer required.
  */
 GSList *object_class_get_list_sorted(const char *implements_type,
                               bool include_abstract);
-- 
2.21.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]