Monkey: Clean up on completion of downloads

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-03-22 13:08:36 +00:00
parent 677d757a6c
commit d3a80a9aae
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,7 @@ struct gui_download_window {
struct gui_download_window *r_next;
struct gui_download_window *r_prev;
struct gui_window *g;
download_context *dlctx;
uint32_t dwin_num;
char *host; /* ignore */
};
@ -49,6 +50,7 @@ gui_download_window_create(download_context *ctx,
return NULL;
ret->g = parent;
ret->dwin_num = dwin_ctr++;
ret->dlctx = ctx;
RING_INSERT(dw_ring, ret);
@ -79,6 +81,7 @@ gui_download_window_done(struct gui_download_window *dw)
{
moutf(MOUT_DOWNLOAD, "DONE DWIN %u", dw->dwin_num);
RING_REMOVE(dw_ring, dw);
download_context_destroy(dw->dlctx);
free(dw);
}