Memory.clearPointer

Clears a reference to a variable.

@pp must not be %NULL.

If the reference is %NULL then this function does nothing. Otherwise, the variable is destroyed using @destroy and the pointer is set to %NULL.

A macro is also included that allows this function to be used without pointer casts.

struct Memory
static
void
clearPointer
(
void** pp
,
GDestroyNotify destroy
)

Parameters

pp void**

a pointer to a variable, struct member etc. holding a pointer

destroy GDestroyNotify

a function to which a gpointer can be passed, to destroy *@pp

Meta

Since

2.34