File: demo/src/main/java/com/inksdk/demo/MainActivity.kt:173-189
refreshStatusOnEpd posts EpdController.refreshScreen(status, ...) to a HandlerThread. onDestroy calls quitSafely(), which lets the currently-executing message complete but does not block.
If a refresh is mid-flight (the comment notes it can take "hundreds of ms"), the background thread still holds status (and transitively the destroyed Activity) for the duration. Low-impact — transient leak measured in hundreds of ms — but worth noting given the explicit goal of running on a background thread because it is slow.
Suggested fix: hold status via a WeakReference<TextView>, or null-out a guarded reference in onDestroy and check it inside the posted Runnable.
File:
demo/src/main/java/com/inksdk/demo/MainActivity.kt:173-189refreshStatusOnEpdpostsEpdController.refreshScreen(status, ...)to a HandlerThread.onDestroycallsquitSafely(), which lets the currently-executing message complete but does not block.If a refresh is mid-flight (the comment notes it can take "hundreds of ms"), the background thread still holds
status(and transitively the destroyedActivity) for the duration. Low-impact — transient leak measured in hundreds of ms — but worth noting given the explicit goal of running on a background thread because it is slow.Suggested fix: hold
statusvia aWeakReference<TextView>, or null-out a guarded reference inonDestroyand check it inside the posted Runnable.