Skip to content

MainActivity: background EPD refresh holds View reference across Activity destroy #4

Description

@imedwei

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions