X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=thread.c;h=57b1bcbfbc1c60c5f78806ccccac312c14e947b2;hb=8e037c67a88cb4680c4391134c578e3b55a80f8a;hp=cd9991421444e73a774a3a46d74dfe66debafee5;hpb=e4ebc9b0ae5de07d53d8b0ecf594244e1bc44d0a;p=apps%2Fmadmutt.git diff --git a/thread.c b/thread.c index cd99914..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); } } @@ -1259,7 +1261,7 @@ static void clean_references (THREAD * brk, THREAD * cur) if (done) { HEADER *h = cur->message; - /* clearing the References: header from obsolete Message-Id(s) */ + /* clearing the References: header from obsolete Message-ID(s) */ mutt_free_list (&ref->next); h->env->refs_changed = h->changed = 1; @@ -1271,7 +1273,7 @@ void mutt_break_thread (HEADER * hdr) { mutt_free_list (&hdr->env->in_reply_to); mutt_free_list (&hdr->env->references); - hdr->env->irt_changed = hdr->env->refs_changed = 1; + hdr->env->irt_changed = hdr->env->refs_changed = hdr->changed = 1; clean_references (hdr->thread, hdr->thread->child); }