From d0d3e96cbb77cddee69ad7f8740d562d27051fc5 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Wed, 17 Sep 2003 12:56:43 +0000 Subject: [project @ 2003-09-17 12:56:43 by bursa] Fix memory corruption when content destroyed from CONTENT_MSG_LOADING. svn path=/import/netsurf/; revision=295 --- content/content.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/content.c b/content/content.c index 4e63c9ceb..7489d1838 100644 --- a/content/content.c +++ b/content/content.c @@ -180,8 +180,10 @@ void content_set_type(struct content *c, content_type type, char* mime_type) c->type = type; c->mime_type = xstrdup(mime_type); c->status = CONTENT_STATUS_LOADING; - content_broadcast(c, CONTENT_MSG_LOADING, 0); handler_map[type].create(c); + content_broadcast(c, CONTENT_MSG_LOADING, 0); + /* c may be destroyed at this point as a result of + * CONTENT_MSG_LOADING, so must not be accessed */ } -- cgit v1.2.3