Executor Never Shut Down (ARCH8040)
هذا المحتوى غير متوفر بلغتك بعد.
Key kotlin.async.executor-never-shut-down · Severity warning · Category async
Flags an ExecutorService created with Executors.newXxx that is never shut down - its threads keep the JVM alive.
Incorrect
Section titled “Incorrect”val pool = Executors.newFixedThreadPool(4)Correct
Section titled “Correct”val pool = Executors.newFixedThreadPool(4)try { work(pool) } finally { pool.shutdown() }Shut the executor down in finally / close(), or use a coroutine dispatcher with structured scope.