Skip to content

Commit abbe723

Browse files
committed
fix(http): always post the heartbeat back to the main thread to avoid possible race conditions
1 parent 6f1d0d6 commit abbe723

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

bugsnag-plugin-android-apphang/src/main/java/com/bugsnag/android/internal/LooperMonitorThread.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ internal class LooperMonitorThread(
6969

7070
if (timeSinceLastHeartbeat >= appHangThresholdMillis) {
7171
reportAppHang(timeSinceLastHeartbeat)
72-
} else {
73-
if (!handler.post(heartbeat)) {
74-
// handler.post returning false means the Looper has likely quit
75-
isRunning.set(false)
76-
}
72+
}
73+
74+
if (!handler.post(heartbeat)) {
75+
// handler.post returning false means the Looper has likely quit
76+
isRunning.set(false)
7777
}
7878
}
7979
}

0 commit comments

Comments
 (0)