diff options
author | Kevin McCarthy <kevin@8t8.us> | 2017-08-10 18:18:18 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2017-08-10 18:18:18 -0700 |
commit | a19e52661bb5f4e6d34c803f469f6835c309e06a (patch) | |
tree | bb6d0f16ff3fc33e256d2088e19330818e1469e7 /attach.c | |
parent | 8295a531a385e4dc769a43654e06e1f2c344129c (diff) |
Create ATTACH_CONTEXT to hold attachment index. (see #3728)
Move the idx and idxlen into ATTACH_CONTEXT. In subsequence patches,
this structure will hold more useful items, such as the virtual index.
The swap out is straightforward, except for:
* update_idx() in compose.c, which post-increments the idxlen in the
call and again in the function.
* mutt_gen_attach_list() which doesn't need to returns the new values.
Diffstat (limited to 'attach.c')
-rw-r--r-- | attach.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1042,3 +1042,20 @@ int mutt_print_attachment (FILE *fp, BODY *a) return 0; } } + +void mutt_free_attach_context (ATTACH_CONTEXT **pactx) +{ + int i; + ATTACH_CONTEXT *actx = *pactx; + + for (i = 0; i < actx->idxlen; i++) + { + if (actx->idx[i]->content) + actx->idx[i]->content->aptr = NULL; + FREE (&actx->idx[i]->tree); + FREE (&actx->idx[i]); + } + FREE (&actx->idx); + + FREE (pactx); /* __FREE_CHECKED__ */ +} |