Repository navigation
Conversation
On Android each CameraFrameOutput owns a single-thread executor that dispose() never shuts down, so every disposed output leaves a live thread behind. Assert that the output's thread rejects new work once the output is disposed.
|
@dmandrade is attempting to deploy a commit to the Margelo Team on Vercel. A member of the Team first needs to authorize it. |
9 of 18 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On Android, every
CameraFrameOutputowns a single-thread executor (IdentifiableExecutor), andHybridFrameOutput.dispose()/HybridDepthFrameOutput.dispose()only callclearAnalyzer(). Nothing callsshutdown()on it, so each disposed output leaves a livecom.margelo.camera.framethread behind. Combined withuseFrameOutputnever disposing its output, the count grows by one per camera mount: 1 to 8 over 8 open/close cycles in our app, and 42 before the app froze in a long session.Test
Adds one Harness test that creates a frame output, runs a task on its
thread, disposes the output, and asserts the thread rejects new work. It is red onmainbecause the executor keeps running.No camera session is needed: the executor thread starts on the first task.
Notes
DispatchQueue, which doesn't leak an OS thread but would also keep accepting work, so this may be red on iOS too. Whether "a disposed output's thread rejects work" should hold on both platforms is your call.dispose()methods and ignores late CameraX callbacks. For this test to pass,runOnThreadwould also have to throw after shutdown. Happy to push that here if this direction looks right.