fix: 修复 noDataWatchdogTask 潜在的内存泄漏问题

在 Runnable 中添加生命周期检查,防止 Activity 销毁后任务继续执行。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-01 17:58:22 +08:00
co-authored by Claude Sonnet 4.6
parent 3d67dd2c2d
commit c23c215941
@@ -273,6 +273,9 @@ class HomeActivity : BaseActivity() {
*/
private val noDataWatchdogTask = object : Runnable {
override fun run() {
// 生命周期检查,防止 Activity 销毁后继续执行
if (isFinishing || isDestroyed) return
val elapsed = System.currentTimeMillis() - lastDataReceivedTime
if (elapsed >= 5 * 60 * 1000L) {
if (noDataWarningDialog == null) {