Thema: Delphi Could Not Bind Socket

Einzelnen Beitrag anzeigen

Benutzerbild von wicht
wicht

Registriert seit: 15. Jan 2006
Ort: Das schöne Enger nahe Bielefeld
809 Beiträge
 
Delphi XE Professional
 
#9

Re: Could Not Bind Socket

  Alt 19. Aug 2009, 14:38
Mach es lieber so, sonst gibt's ein Handle-Leak (glaube ich):

Delphi-Quellcode:
var
  hProc: Cardinal
  // ...
begin
        // ...
        If KillProcess then
         begin
           hProc := OpenProcess(Process_Terminate, False, pe32.th32ProcessID);
           if hProc <> 0 then
           begin
             Result := TerminateProcess(hProc, 0)
             CloseHandle(hProc); // <<---
           end;
         end
         // ...
end;
http://streamwriter.org

"I make hits. Not the public. I tell the DJ’s what to play. Understand?"
  Mit Zitat antworten Zitat