Browse Source

* Force stop now first sends stop, then shutdown signals (bug ID 19510)

git-svn-id: trunk@35624 -
michael 8 years ago
parent
commit
d831c57883
1 changed files with 12 additions and 1 deletions
  1. 12 1
      packages/fcl-extra/src/daemonapp.pp

+ 12 - 1
packages/fcl-extra/src/daemonapp.pp

@@ -1030,7 +1030,18 @@ begin
       If Components[i] is TDaemonController then
         L.Add(Components[i]);
     For I:=L.Count-1 downto 0 do
-      TDaemonController(L[i]).Controller(ControlCodes[Force],0,Nil);
+      TDaemonController(L[i]).Controller(SERVICE_CONTROL_STOP,0,Nil);
+    if Force then
+      begin
+      Sleep(50); // Give the daemons some chance to actually stop
+      L.Clear;
+      For I:=0 to ComponentCount-1 do
+        If (Components[i] is TDaemonController) and 
+           (TDaemonController(Components[i]).LastStatus<>csStopped)  then
+          L.Add(Components[i]);
+      For I:=L.Count-1 downto 0 do
+        TDaemonController(L[i]).Controller(SERVICE_CONTROL_SHUTDOWN,0,Nil);
+      end;  
   finally
     L.Free;
   end;