mshtml: Use task destructor for set_downloading task.

This commit is contained in:
Jacek Caban 2011-08-03 12:36:41 +02:00 committed by Alexandre Julliard
parent 9f77da607f
commit 923484bd7c
1 changed files with 9 additions and 2 deletions

View File

@ -166,7 +166,6 @@ static void set_downloading_proc(task_t *_task)
TRACE("(%p)\n", doc);
set_statustext(doc, IDS_STATUS_DOWNLOADINGFROM, task->url);
CoTaskMemFree(task->url);
if(task->set_download)
set_download_state(doc, 1);
@ -188,6 +187,14 @@ static void set_downloading_proc(task_t *_task)
}
}
static void set_downloading_task_destr(task_t *_task)
{
download_proc_task_t *task = (download_proc_task_t*)_task;
CoTaskMemFree(task->url);
heap_free(task);
}
void prepare_for_binding(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BOOL navigated_binding)
{
HRESULT hres;
@ -303,7 +310,7 @@ HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannel
download_task->doc = This->doc_obj;
download_task->set_download = set_download;
download_task->url = url;
push_task(&download_task->header, set_downloading_proc, NULL, This->doc_obj->basedoc.task_magic);
push_task(&download_task->header, set_downloading_proc, set_downloading_task_destr, This->doc_obj->basedoc.task_magic);
return S_OK;
}