diff options
author | Cyrille Comar <comar@adacore.com> | 2007-08-14 10:49:45 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-14 10:49:45 +0200 |
commit | 95dd3302c5d38a4ef4fbef1279fb4afcc1523bd2 (patch) | |
tree | 60449c36c76f63d43a8f115f25698f7a80ff79d8 /gcc | |
parent | 2353aeebc50124bc27a9d65d09bc696cca7cd19f (diff) | |
download | gcc-95dd3302c5d38a4ef4fbef1279fb4afcc1523bd2.zip gcc-95dd3302c5d38a4ef4fbef1279fb4afcc1523bd2.tar.gz gcc-95dd3302c5d38a4ef4fbef1279fb4afcc1523bd2.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/s-finimp.adb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/s-finimp.adb b/gcc/ada/s-finimp.adb index 4f6c4c1..4ed7c6c 100644 --- a/gcc/ada/s-finimp.adb +++ b/gcc/ada/s-finimp.adb @@ -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; |