[glib/th/g-ptr-array-set-null-terminated: 31/32] fixup! array: add support for %NULL termination in GPtrArray




commit 9155e076fc9f28192c13f693c2a8bf6cdf0d7022
Author: Thomas Haller <thaller redhat com>
Date:   Mon Jan 25 16:38:10 2021 +0100

    fixup! array: add support for %NULL termination in GPtrArray

 glib/garray.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/glib/garray.c b/glib/garray.c
index 79a70c5f9..8e2cd56a6 100644
--- a/glib/garray.c
+++ b/glib/garray.c
@@ -1143,6 +1143,10 @@ g_ptr_array_new (void)
  * the underlying array is preserved for use elsewhere and returned
  * to the caller.
  *
+ * Note that if the array is %NULL terminated this may still return
+ * %NULL if the length of the array was zero and pdata was not yet
+ * allocated.
+ *
  * Even if set, the #GDestroyNotify function will never be called
  * on the current contents of the array and the caller is
  * responsible for freeing the array elements.


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