Exemple #1
0
/*--------------------------------------------------------- */
static bool_t
lub_heap_foreach_context(bool_t (*fn)(lub_heap_context_t *,void *),
                         void    *arg)
{
    bool_t                  result = BOOL_FALSE;
    lub_heap_context_t    * context;
    lub_bintree_iterator_t  iter;

    lub_heap_context_meta_init();

    {
        lub_heap_leak_t *leak = lub_heap_leak_instance();
        for(context = lub_bintree_findfirst(&leak->m_context_tree),
            context ? lub_bintree_iterator_init(&iter,&leak->m_context_tree,context) : (void)0;
            context;
            context = lub_bintree_iterator_next(&iter))
        {
            lub_heap_leak_release(leak);
            /* invoke the specified method on this context */
            result = fn(context,arg);
            leak = lub_heap_leak_instance();
        }
        lub_heap_leak_release(leak);
    }
    return result;
}
Exemple #2
0
/*--------------------------------------------------------- */
void clish_shell__fini_pwd(clish_shell_pwd_t *pwd)
{
	clish_var_t *var;

	lub_string_free(pwd->line);
	lub_string_free(pwd->cmd);
	if (pwd->prefix)
		lub_string_free(pwd->prefix);
	pwd->view = NULL;
	clish_pargv_delete(pwd->pargv);
	/* delete each VAR held  */
	while ((var = lub_bintree_findfirst(&pwd->viewid))) {
		lub_bintree_remove(&pwd->viewid, var);
		clish_var_delete(var);
	}
}