Skip to content

Android: stop the native session before closing the USB connection on engine detach #7

Description

@cornpip

onDetachedFromEngine calls closeCurrentConnection() without stopping the shared native session first (uvc_close_device). If the engine detaches while a preview is active, libuvc's transfer threads can keep using the closed (and possibly reused) file descriptor.

Same pattern as the Linux plugin dispose issue found in PR #6 and fixed there in 57994dd; the fix is the same shape: tear down the native session before releasing the connection.

Low urgency: the path only triggers on engine teardown with an active preview (e.g. add-to-app engine destruction); normal app exits kill the process outright.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions