Skip to content

Commit

Permalink
[api]: Ensure the temp image file is deleted after capture is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagohm committed Aug 10, 2024
1 parent e3b1e5e commit 78a0b08
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import java.time.Duration
import java.time.LocalDateTime
import java.util.concurrent.atomic.AtomicBoolean
import kotlin.io.path.createParentDirectories
import kotlin.io.path.deleteIfExists
import kotlin.io.path.moveTo
import kotlin.io.path.outputStream

Expand Down Expand Up @@ -112,6 +113,7 @@ data class CameraExposureTask(

override fun close() {
onCancel(CancellationSource.Close)
outputPath.deleteIfExists()
super.close()
}

Expand Down

0 comments on commit 78a0b08

Please sign in to comment.