MCPcopy Create free account
hub / github.com/ConEmu/ConEmu / ProcessRemove

Method ProcessRemove

src/ConEmuCD/ConProcess.cpp:412–449  ·  view source on GitHub ↗

We receive this via CECMD_FARDETACHED or sst_AltServerStop/sst_ComspecStop/sst_AppStop So, the process leaves the console indeed

Source from the content-addressed store, hash-verified

410// We receive this via CECMD_FARDETACHED or sst_AltServerStop/sst_ComspecStop/sst_AppStop
411// So, the process leaves the console indeed
412bool ConProcess::ProcessRemove(DWORD nPID, UINT nPrevCount, MSectionLock& CS)
413{
414 bool lbChanged = false;
415 _ASSERTE(nPID != 0);
416
417 CS.Lock(csProc);
418
419 // Remove it from our list
420 _ASSERTE(pnProcesses[0] == gnSelfPID);
421 DWORD nChange = 0;
422 for (DWORD n = 0; n < nPrevCount; n++)
423 {
424 if (pnProcesses[n] == nPID)
425 {
426 CS.RelockExclusive(200);
427 lbChanged = true;
428 if (nLastFoundPID == nPID)
429 nLastFoundPID = 0;
430 nProcessCount--;
431 continue;
432 }
433 if (lbChanged)
434 {
435 pnProcesses[nChange] = pnProcesses[n];
436 }
437 nChange++;
438 }
439
440 for (INT_PTR i = 0; i < xRequests.size(); ++i)
441 {
442 if (xRequests[i].pid != nPID)
443 continue;
444 xRequests.erase(i);
445 break;
446 }
447
448 return lbChanged;
449}
450
451// create=false used to erasing on reset
452INT_PTR ConProcess::GetXRequestIndex(DWORD pid, bool create)

Callers 2

cmd_CmdStartStopFunction · 0.80
OnFarDetachedMethod · 0.80

Calls 4

RelockExclusiveMethod · 0.80
eraseMethod · 0.80
LockMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected