only leaf nodes should be visited.
This name has been introduced in 2.6, for older version use g_traverse_leafs.