mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-20 06:35:50 +02:00
Bug 160371: Kill the same process the second time results in ArrayIndexOutOfBoundsException and StringIndexOutOfBoundsException
This commit is contained in:
parent
cf6257e12b
commit
c923ecb2cc
3 changed files with 13 additions and 1 deletions
|
@ -191,6 +191,12 @@ public class DStoreProcessService extends AbstractProcessService implements IPro
|
||||||
|
|
||||||
// run kill command on host
|
// run kill command on host
|
||||||
DStoreHostProcess process = (DStoreHostProcess) getProcess(monitor, PID);
|
DStoreHostProcess process = (DStoreHostProcess) getProcess(monitor, PID);
|
||||||
|
|
||||||
|
// if there is no process, simply return true
|
||||||
|
if (process == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
DataElement deObj = (DataElement) process.getObject();
|
DataElement deObj = (DataElement) process.getObject();
|
||||||
DataElement killCmd = ds.localDescriptorQuery(deObj.getDescriptor(), C_PROCESS_KILL);
|
DataElement killCmd = ds.localDescriptorQuery(deObj.getDescriptor(), C_PROCESS_KILL);
|
||||||
deObj.setAttribute(DE.A_SOURCE, signal);
|
deObj.setAttribute(DE.A_SOURCE, signal);
|
||||||
|
|
|
@ -75,6 +75,12 @@ public class LocalProcessService extends AbstractProcessService implements ILoca
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
process = getProcess(monitor, PID);
|
process = getProcess(monitor, PID);
|
||||||
|
|
||||||
|
// if there is no process, simply return true
|
||||||
|
if (process == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
handler.kill(process, signal);
|
handler.kill(process, signal);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ public abstract class AbstractProcessService implements IProcessService
|
||||||
rpfs.setPid(pidString);
|
rpfs.setPid(pidString);
|
||||||
|
|
||||||
IHostProcess[] results = listAllProcesses(monitor, rpfs);
|
IHostProcess[] results = listAllProcesses(monitor, rpfs);
|
||||||
if (results == null) return null;
|
if ((results == null) || (results.length == 0)) return null;
|
||||||
else return results[0];
|
else return results[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue