unrefToStrv

Decreases the reference count on the string vector builder, and returns its contents as a NULL-terminated string array.

This function is especially useful for cases where it's not possible to use g_autoptr().

GStrvBuilder *builder = g_strv_builder_new ();
g_strv_builder_add (builder, "hello");
g_strv_builder_add (builder, "world");

GStrv array = g_strv_builder_unref_to_strv (builder);

g_assert_true (g_strv_equal (array, (const char *[]) { "hello", "world", NULL }));

g_strfreev (array);

Return

the constructed string array

Since

2.82