Thema: Delphi Ist Anwendung noch aktiv

Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#3
  Alt 30. Dez 2002, 04:02
Zitat von Christian Seehase:
Abschiessen kannst Du die Prozesse dann mittels TerminateProcess.
Diese Funktion sollte aber nur in Notfällen angewandt werden, da eventuelle Aufräumarbeiten (z.b. Freigabe von Resourcen, wie Speicher oder Handles) nicht mehr durchgeführt werden.
Falsch, das habe ich früher auch gedacht. Im Richter habe ich dann was anderes gelesen. So bald ein Process beendet wird, räumt Windows den Speicher komplett wieder auf, so das der Speicher, die Ressourcen und ähnliches Windows wieder zur Verfügung stehen.

Dies wird auch vom PSDK mehr oder weniger bestätigt:
Zitat:
Terminating a process causes the following:
  1. All object handles opened by the process are closed.
  2. All threads in the process terminate their execution. Each thread exits when all its pending I/O has been completed or canceled. The process exits after all its threads exit.
  3. The state of the process object becomes signaled, satisfying any threads that had been waiting for the process to terminate. The process object is deleted when the last handle to the process is closed.
  4. The states of all threads of the process become signaled, satisfying any threads that had been waiting for the threads to terminate.
  5. The termination status of the process changes from STILL_ACTIVE to the exit value of the process.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat