From c0f49a27851c9db13360359baef507df7290f0aa Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 13 Dec 2010 08:34:01 +0000 Subject: 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 --- content/llcache.c | 19 +++++++------------ 1 file 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; } -- cgit v1.2.3