Einzelnen Beitrag anzeigen

Benutzerbild von Sanchez
Sanchez

Registriert seit: 24. Apr 2003
Ort: Neumarkt Stmk
892 Beiträge
 
Delphi XE6 Enterprise
 
#1

TWebModule.OnDestroy in D6 triggern

  Alt 18. Okt 2004, 07:52
Mir ist vor kurzem aufgefallen, dass in D6 kein OnDestroy-Event triggert, wenn ich meine Apache-DSO's beende. Dazu kommt ins dpr-File dieser Code:

Delphi-Quellcode:
uses ..., windows;

procedure DLLHandler(Reason: Integer);
var
  P: procedure;
begin
  if Reason = DLL_PROCESS_DETACH then // Indicates that the library is detaching from the address space of the calling process as a result of a clean exit or a call to FreeLibrary or (dlclose on Linux).
  begin
    while ExitProc <> nil do
    begin
      @P := ExitProc;
      ExitProc := nil;
      P;
    end;
  end;
end;

begin
  DllProc := DLLHandler;
  ....
end;
grüße, daniel
Daniel
Testen ist feige!
  Mit Zitat antworten Zitat