diff --git a/extras/rhubarb-for-spine/src/main/kotlin/com/rhubarb_lip_sync/rhubarb_for_spine/RhubarbTask.kt b/extras/rhubarb-for-spine/src/main/kotlin/com/rhubarb_lip_sync/rhubarb_for_spine/RhubarbTask.kt index 34a5505..8c23dbc 100644 --- a/extras/rhubarb-for-spine/src/main/kotlin/com/rhubarb_lip_sync/rhubarb_for_spine/RhubarbTask.kt +++ b/extras/rhubarb-for-spine/src/main/kotlin/com/rhubarb_lip_sync/rhubarb_for_spine/RhubarbTask.kt @@ -44,7 +44,8 @@ class RhubarbTask( val message = parseJsonObject(line) when (message.string("type")!!) { "progress" -> { - reportProgress(message.double("value")!!)} + reportProgress(message.double("value")!!) + } "success" -> { reportProgress(1.0) val resultString = String(Files.readAllBytes(outputFile.filePath), StandardCharsets.UTF_8) @@ -60,6 +61,8 @@ class RhubarbTask( throw e } catch (e: EOFException) { throw Exception("Rhubarb terminated unexpectedly.") + } finally { + process.waitFor(); } }}