mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 20:19:23 +02:00
FpDebug: Windows, fix leaking filehandles (again), see r59552 #122dfbd2ce / needed until forked processes are handled.
git-svn-id: trunk@59741 -
This commit is contained in:
parent
0506cd7fb5
commit
a33608de2e
@ -538,6 +538,15 @@ begin
|
||||
result := Windows.WaitForDebugEvent(MDebugEvent, INFINITE);
|
||||
ProcessIdentifier:=MDebugEvent.dwProcessId;
|
||||
ThreadIdentifier:=MDebugEvent.dwThreadId;
|
||||
|
||||
// Should be done in AnalyseDebugEvent, but that is not called for forked processes
|
||||
if (MDebugEvent.dwDebugEventCode = CREATE_PROCESS_DEBUG_EVENT) and
|
||||
(MDebugEvent.dwProcessId <> ProcessID) and
|
||||
(MDebugEvent.CreateProcessInfo.hFile <> 0)
|
||||
then begin
|
||||
CloseHandle(MDebugEvent.CreateProcessInfo.hFile);
|
||||
MDebugEvent.CreateProcessInfo.hFile := 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDbgWinProcess.AnalyseDebugEvent(AThread: TDbgThread): TFPDEvent;
|
||||
|
Loading…
Reference in New Issue
Block a user