Commit 95dd3302 by Cyrille Comar Committed by Arnaud Charlet

s-finimp.adb (Detach_From_Final_List): make this procedure idempotent since it…

s-finimp.adb (Detach_From_Final_List): make this procedure idempotent since it is potentially used in cases implying...

2007-08-14  Cyrille Comar  <comar@adacore.com>

	* s-finimp.adb (Detach_From_Final_List): make this procedure idempotent
	since it is potentially used in cases implying double finalization of
	the same object.

From-SVN: r127462
parent 2353aeeb
......@@ -258,7 +258,7 @@ package body System.Finalization_Implementation is
-----------------------------
-- We know that the detach object is neither at the beginning nor at the
-- end of the list, thank's to the dummy First and Last Elements but the
-- end of the list, thanks to the dummy First and Last Elements, but the
-- object may not be attached at all if it is Finalize_Storage_Only
procedure Detach_From_Final_List (Obj : in out Finalizable) is
......@@ -273,6 +273,13 @@ package body System.Finalization_Implementation is
SSL.Lock_Task.all;
Obj.Next.Prev := Obj.Prev;
Obj.Prev.Next := Obj.Next;
-- Reset the pointers so that a new finalization of the same object
-- has no effect on the finalization list.
Obj.Next := null;
Obj.Prev := null;
SSL.Unlock_Task.all;
end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment