mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 17:54:33 +03:00
Fix bug #3188376: there may be no window for a download if there were no headers or data.
Additionally, ensure we clean up on error. svn path=/trunk/netsurf/; revision=11748
This commit is contained in:
parent
7fb4e84c77
commit
66247f5b37
@ -137,15 +137,19 @@ static nserror download_callback(llcache_handle *handle,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LLCACHE_EVENT_DONE:
|
case LLCACHE_EVENT_DONE:
|
||||||
assert(ctx->window != NULL);
|
/* There may be no associated window if there was no data or headers */
|
||||||
|
if (ctx->window != NULL)
|
||||||
gui_download_window_done(ctx->window);
|
gui_download_window_done(ctx->window);
|
||||||
|
else
|
||||||
|
download_context_destroy(ctx);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LLCACHE_EVENT_ERROR:
|
case LLCACHE_EVENT_ERROR:
|
||||||
if (ctx->window != NULL)
|
if (ctx->window != NULL)
|
||||||
gui_download_window_error(ctx->window, event->data.msg);
|
gui_download_window_error(ctx->window, event->data.msg);
|
||||||
|
else
|
||||||
|
download_context_destroy(ctx);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user