Fix: cleanup working dir after blender has exited

This commit is contained in:
M*C*O
2024-04-19 18:40:55 +00:00
committed by Laurent Clouet
parent a1f6343d49
commit 51e1388aaa
4 changed files with 25 additions and 14 deletions

View File

@@ -145,9 +145,18 @@ public abstract class OS {
* @param proc Process to kill
* @return true if proc wasn't null and was destroyed
*/
public boolean kill(Process proc) {
public boolean kill(Process proc) throws InterruptedException {
if (proc != null) {
proc.destroy();
for (int i = 0; i <= 30; i++) {
if (proc.isAlive() == false) {
return true;
}
java.lang.Thread.sleep(100);
}
proc.destroyForcibly();
return true;
}
return false;