Skip to content

Commit a4fe2be

Browse files
InnoraGDeweyReed
authored andcommitted
Suppress app crash
No more leaks and crash seen after enhancing onDestroy
1 parent 343c9ab commit a4fe2be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app-timer-run/src/main/java/xyz/aprildown/timer/app/timer/run/MachineService.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,14 @@ class MachineService :
168168
* Just release all resources
169169
*/
170170
override fun onDestroy() {
171-
super.onDestroy()
171+
binder = null
172172
presenter.dropView()
173+
phoneCallReceiver?.unregister()
174+
phoneCallReceiver = null
175+
toForegroundHandler.removeCallbacksAndMessages(null)
176+
foregroundNotifHandler?.removeCallbacksAndMessages(null)
177+
foregroundNotifHandler = null
178+
super.onDestroy()
173179
}
174180

175181
//

0 commit comments

Comments
 (0)