I'm writing some C code where I want to have a NULL-terminated GPtrArray containing static strings. Typically, I would use g_ptr_array_new_null_terminated () to construct a NULL-terminated GPtrArray, but it requires me to specify a function that frees the elements upon destruction—something you don't want with statically allocated strings, of course. However, I don't find any constructor that gives you a NULL-terminated array that doesn't require providing an element free function: both g_ptr_array_new_from_null_terminated_array () and g_ptr_array_new_take_null_terminated () require an element_free_func argument that cannot be set to NULL according to the documentation.
One option would of course be to just make a no-op function that fits the GDestroyNotify function signature, but it doesn't feel particularly elegant. Is there a better way of achieving this?