Browse Source

* halt in the finalization statement of a unit lead to an endless loop; fixed

florian 25 years ago
parent
commit
548f14e16d
1 changed files with 9 additions and 4 deletions
  1. 9 4
      rtl/inc/system.inc

+ 9 - 4
rtl/inc/system.inc

@@ -405,9 +405,11 @@ begin
    begin
    begin
      while (InitCount>0) do
      while (InitCount>0) do
       begin
       begin
-        if assigned(Procs[InitCount].FinalProc) then
-         Procs[InitCount].FinalProc();
+        // we've to decrement the cound before calling the final. code
+        // else a halt in the final. code leads to a endless loop
         dec(InitCount);
         dec(InitCount);
+        if assigned(Procs[InitCount+1].FinalProc) then
+         Procs[InitCount+1].FinalProc();
       end;
       end;
    end;
    end;
 end;
 end;
@@ -615,7 +617,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.85  2000-03-14 07:31:57  pierre
+  Revision 1.86  2000-04-02 09:39:25  florian
+    * halt in the finalization statement of a unit lead to an endless loop; fixed
+
+  Revision 1.85  2000/03/14 07:31:57  pierre
    + HandleErrorAddrFrame
    + HandleErrorAddrFrame
 
 
   Revision 1.84  2000/02/26 15:49:40  jonas
   Revision 1.84  2000/02/26 15:49:40  jonas
@@ -684,4 +689,4 @@ end;
   Revision 1.65  1999/07/28 12:58:22  peter
   Revision 1.65  1999/07/28 12:58:22  peter
     * fixed assert() to push/pop registers
     * fixed assert() to push/pop registers
 
 
-}
+}