Kill orphan Blender process after rendering
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
package com.sheepit.client;
|
||||
|
||||
import com.sheepit.client.os.OS;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -92,7 +93,19 @@ import oshi.software.os.OSProcess;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void kill() {
|
||||
if (process != null){
|
||||
try {
|
||||
OS.getOS().kill(process);
|
||||
log.debug("RenderProcess::Process killed");
|
||||
} catch (NullPointerException ex) { // We are racing the system itself, we can't avoid catching NPE's
|
||||
log.debug("RenderProcess::Handled process becoming unavailable before getting killed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void finish() {
|
||||
kill();
|
||||
endTime = new Date().getTime();
|
||||
osProcess = null;
|
||||
process = null;
|
||||
|
||||
Reference in New Issue
Block a user