diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-07-20 21:39:51 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-07-20 21:39:51 +0000 |
commit | dc6c58ec4150d933bf7054d55c1d5922ba513228 (patch) | |
tree | a33dcf679548a72dd03846eefcf945b659190709 /content/content.c | |
parent | cfd56cadf2a2fc98bddecce3f7139f484c92d1a3 (diff) | |
download | netsurf-dc6c58ec4150d933bf7054d55c1d5922ba513228.tar.gz netsurf-dc6c58ec4150d933bf7054d55c1d5922ba513228.tar.bz2 |
Fix transition from LOADING to ERROR state after content has been locked for conversion
svn path=/trunk/netsurf/; revision=12614
Diffstat (limited to 'content/content.c')
-rw-r--r-- | content/content.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/content/content.c b/content/content.c index ed5202009..f792e794a 100644 --- a/content/content.c +++ b/content/content.c @@ -280,8 +280,7 @@ void content_convert(struct content *c) if (c->handler->data_complete != NULL) { c->locked = true; if (c->handler->data_complete(c) == false) { - c->locked = false; - c->status = CONTENT_STATUS_ERROR; + content_set_error(c); } /* Conversion to the READY state will unlock the content */ } else { @@ -322,6 +321,17 @@ void content_set_done(struct content *c) content_broadcast(c, CONTENT_MSG_DONE, msg_data); } +/** + * Put a content in status CONTENT_STATUS_ERROR and unlock the content. + * + * \note We expect the caller to broadcast an error report if needed. + */ + +void content_set_error(struct content *c) +{ + c->locked = false; + c->status = CONTENT_STATUS_ERROR; +} /** * Reformat to new size. |