Module: wine Branch: master Commit: ab9ded062fe39ba16ea42ed3e1b755975e025853 URL: https://source.winehq.org/git/wine.git/?a=commit;h=ab9ded062fe39ba16ea42ed3e...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Sep 24 14:14:22 2020 +0200
server: Restart search from the start when releasing permanent objects at exit.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
server/object.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/server/object.c b/server/object.c index 77dec733a5..729114ff9c 100644 --- a/server/object.c +++ b/server/object.c @@ -67,11 +67,21 @@ void dump_objects(void)
void close_objects(void) { - struct object *obj, *obj2; - /* release the permanent objects */ - LIST_FOR_EACH_ENTRY_SAFE( obj, obj2, &object_list, struct object, obj_list ) - if (obj->is_permanent) release_object( obj ); + for (;;) + { + struct object *obj; + int found = 0; + + LIST_FOR_EACH_ENTRY( obj, &object_list, struct object, obj_list ) + { + if (!(found = obj->is_permanent)) continue; + obj->is_permanent = 0; + release_object( obj ); + break; + } + if (!found) break; + }
dump_objects(); /* dump any remaining objects */ }