summaryrefslogtreecommitdiff
path: root/content/llcache.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-12-13 08:34:01 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-12-13 08:34:01 +0000
commitc0f49a27851c9db13360359baef507df7290f0aa (patch)
treeff78ebc0a596dd107266776113233231aca31263 /content/llcache.c
parentf919b689ba56d97c466472826854f5eb4d0ec35e (diff)
downloadnetsurf-c0f49a27851c9db13360359baef507df7290f0aa.tar.gz
netsurf-c0f49a27851c9db13360359baef507df7290f0aa.tar.bz2
Revert r11047-11050: if we remove a user from an object while it's the iterator target, the effect will be that the iteration terminates early.
Subsequent users that require notifications will simply have their notifications delayed svn path=/trunk/netsurf/; revision=11051
Diffstat (limited to 'content/llcache.c')
-rw-r--r--content/llcache.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/content/llcache.c b/content/llcache.c
index bfd128ba0..0b45c3e31 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -377,12 +377,10 @@ nserror llcache_handle_release(llcache_handle *handle)
error = llcache_object_remove_user(object, user);
if (error == NSERROR_OK) {
/* Can't delete user object if it's the target of an iterator */
- if (user->iterator_target) {
+ if (user->iterator_target)
user->queued_for_delete = true;
- } else {
- user->next = user->prev = NULL;
+ else
error = llcache_object_user_destroy(user);
- }
}
return error;
@@ -1195,11 +1193,11 @@ nserror llcache_object_remove_user(llcache_object *object,
if (user->next != NULL)
user->next->prev = user->prev;
-
- /* Do not invalidate user's prev/next pointers here
- * We rely on them remaining valid if it's currently
- * the target of an iterator */
-
+
+#ifndef NDEBUG
+ user->next = user->prev = NULL;
+#endif
+
#ifdef LLCACHE_TRACE
LOG(("Removing user %p from %p", user, object));
#endif
@@ -1377,7 +1375,6 @@ nserror llcache_object_notify_users(llcache_object *object)
if (user->queued_for_delete) {
next_user = user->next;
- user->next = user->prev = NULL;
llcache_object_user_destroy(user);
continue;
}
@@ -1413,7 +1410,6 @@ nserror llcache_object_notify_users(llcache_object *object)
if (user->queued_for_delete) {
next_user = user->next;
- user->next = user->prev = NULL;
llcache_object_user_destroy(user);
continue;
}
@@ -1435,7 +1431,6 @@ nserror llcache_object_notify_users(llcache_object *object)
if (user->queued_for_delete) {
next_user = user->next;
- user->next = user->prev = NULL;
llcache_object_user_destroy(user);
continue;
}