summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2005-03-24 13:44:24 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2005-03-24 13:44:24 +0000
commit770a3f7494d576cb539e8b382c7743e4991ee6c8 (patch)
tree1e686f4c9962438c99b086cd204808123c86063c /render
parentd4760c09c0298878b6514a3f00974864ef1ab918 (diff)
downloadnetsurf-770a3f7494d576cb539e8b382c7743e4991ee6c8.tar.gz
netsurf-770a3f7494d576cb539e8b382c7743e4991ee6c8.tar.bz2
[project @ 2005-03-24 13:44:24 by rjw]
Don't add fetches that failed to initialise to the object list. svn path=/import/netsurf/; revision=1580
Diffstat (limited to 'render')
-rw-r--r--render/html.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/render/html.c b/render/html.c
index fdc0edbe0..60e29f694 100644
--- a/render/html.c
+++ b/render/html.c
@@ -726,27 +726,33 @@ bool html_fetch_object(struct content *c, char *url, struct box *box,
{
unsigned int i = c->data.html.object_count;
struct content_html_object *object;
+ struct content *c_fetch;
+
+ /* initialise fetch */
+ c_fetch = fetchcache(url, html_object_callback,
+ c, (void *) i, available_width, available_height,
+ true, 0, 0, false, false);
+ if (!c_fetch)
+ return false;
/* add to object list */
object = realloc(c->data.html.object,
(i + 1) * sizeof *c->data.html.object);
- if (!object)
+ if (!object) {
+ content_remove_user(c_fetch, html_object_callback, c, (void*)i);
return false;
+ }
c->data.html.object = object;
c->data.html.object[i].url = url;
c->data.html.object[i].box = box;
c->data.html.object[i].permitted_types = permitted_types;
c->data.html.object[i].background = background;
+ c->data.html.object[i].content = c_fetch;
c->data.html.object_count++;
+ c->active++;
/* start fetch */
- c->data.html.object[i].content = fetchcache(url, html_object_callback,
- c, (void *) i, available_width, available_height,
- true, 0, 0, false, false);
- if (!c->data.html.object[i].content)
- return false;
- c->active++;
- fetchcache_go(c->data.html.object[i].content, c->url,
+ fetchcache_go(c_fetch, c->url,
html_object_callback, c, (void *) i,
available_width, available_height,
0, 0, false);