Function
GLibOnceinit_enter_pointer
since: 2.80
Declaration [src]
gboolean
g_once_init_enter_pointer (
void* location
)
Description [src]
This functions behaves in the same way as g_once_init_enter(), but can can be used to initialize pointers (or #guintptr) instead of #gsize.
static MyStruct *interesting_struct = NULL;
if (g_once_init_enter_pointer (&interesting_struct))
{
MyStruct *setup_value = allocate_my_struct (); // initialization code here
g_once_init_leave_pointer (&interesting_struct, g_steal_pointer (&setup_value));
}
// use interesting_struct here
Available since: 2.80