Fix bufferedReaders not closed

This commit is contained in:
Mygod
2021-02-02 03:03:50 +08:00
parent 8c0aef4446
commit a1d86e4929
4 changed files with 4 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ object RepeaterCommands {
File(if (legacy) CONF_PATH_LEGACY else CONF_PATH_TREBLE).writeText(data)
for (process in File("/proc").listFiles { _, name -> TextUtils.isDigitsOnly(name) }!!) {
val cmdline = try {
File(process, "cmdline").inputStream().bufferedReader().readText()
File(process, "cmdline").inputStream().bufferedReader().use { it.readText() }
} catch (_: IOException) {
continue
}