X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=thread.c;fp=thread.c;h=57b1bcbfbc1c60c5f78806ccccac312c14e947b2;hp=2aa421d581fd703e50a9165f7626ef14f9d38d22;hb=8e037c67a88cb4680c4391134c578e3b55a80f8a;hpb=c25bc063f35aaad6938c2022dae7a283346c2769 diff --git a/thread.c b/thread.c index 2aa421d..57b1bcb 100644 --- a/thread.c +++ b/thread.c @@ -11,6 +11,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "sort.h" #include "thread.h" @@ -129,7 +131,7 @@ static void calculate_visibility (CONTEXT * ctx, int *max_depth) tree->subtree_visible = 0; if (tree->message) { - mem_free (&tree->message->tree); + p_delete(&tree->message->tree); if (VISIBLE (tree->message, ctx)) { tree->deep = 1; tree->visible = 1; @@ -221,8 +223,8 @@ void mutt_draw_tree (CONTEXT * ctx) * From now on we can simply ignore invisible subtrees */ calculate_visibility (ctx, &max_depth); - pfx = mem_malloc (width * max_depth + 2); - arrow = mem_malloc (width * max_depth + 2); + pfx = p_new(char, width * max_depth + 2); + arrow = p_new(char, width * max_depth + 2); while (tree) { if (depth) { myarrow = arrow + (depth - start_depth - (start_depth ? 0 : 1)) * width; @@ -240,7 +242,7 @@ void mutt_draw_tree (CONTEXT * ctx) if (tree->visible) { myarrow[width] = M_TREE_RARROW; myarrow[width + 1] = 0; - new_tree = mem_malloc ((2 + depth * width)); + new_tree = p_new(char, (2 + depth * width)); if (start_depth > 1) { strncpy (new_tree, pfx, (start_depth - 1) * width); strfcpy (new_tree + (start_depth - 1) * width, @@ -307,8 +309,8 @@ void mutt_draw_tree (CONTEXT * ctx) while (!tree->deep); } - mem_free (&pfx); - mem_free (&arrow); + p_delete(&pfx); + p_delete(&arrow); } /* since we may be trying to attach as a pseudo-thread a THREAD that @@ -405,7 +407,7 @@ static THREAD *find_subject (CONTEXT * ctx, THREAD * cur) oldlist = subjects; subjects = subjects->next; - mem_free (&oldlist); + p_delete(&oldlist); } return (last); } @@ -639,7 +641,7 @@ THREAD *mutt_sort_subthreads (THREAD * thread, int init) } else { Sort ^= SORT_REVERSE; - mem_free (&array); + p_delete(&array); return (top); } }