Method

GLibTreeremove

Declaration

gboolean
g_tree_remove (
  GTree* tree,
  gconstpointer key
)

Description

Removes a key/value pair from a GTree.

If the GTree was created using g_tree_new_full(), the key and value are freed using the supplied destroy functions, otherwise you have to make sure that any dynamically allocated values are freed yourself. If the key does not exist in the GTree, the function does nothing.

The cost of maintaining a balanced tree while removing a key/value result in a O(n log(n)) operation where most of the other operations are O(log(n)).

Parameters

key

Type: gconstpointer

The key to remove.

The argument can be NULL.
The data is owned by the caller of the function.

Return value

Type: gboolean

TRUE if the key was found (prior to 2.8, this function returned nothing)