-
Notifications
You must be signed in to change notification settings - Fork 275
[Tizen.Multimedia.AudioIO] Narrow Dispose() catch instead of swallowing all exceptions#7663
Open
JoonghyunCho wants to merge 1 commit into
Open
[Tizen.Multimedia.AudioIO] Narrow Dispose() catch instead of swallowing all exceptions #7663JoonghyunCho wants to merge 1 commit into
JoonghyunCho wants to merge 1 commit into
Conversation
...allowing all exceptions AudioCaptureBase.Dispose(bool) and AudioPlayback.Dispose(bool) wrapped the cleanup call to Unprepare() in an unconditional 'catch (Exception)' with an empty body. That hid every fault, including critical native exceptions, with no log trace. Narrow the silent path to the two cases that are normal during teardown (ObjectDisposedException and InvalidOperationException) and route any other exception to Log.Error so unexpected failures stay visible in dlog. ObjectDisposedException is listed first because it derives from InvalidOperationException. Dispose() still does not rethrow, so external behavior and the Dispose(bool) contract are unchanged. Public API is unchanged. Fixes #7610
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refines exception handling within the Dispose methods of AudioCapture and AudioPlayback. Specifically, it replaces a generic catch-all block with targeted handling for ObjectDisposedException and InvalidOperationException, which are now explicitly ignored with explanatory comments. Other unexpected exceptions are now logged for better observability. I have no feedback to provide.
JoonghyunCho
commented
May 24, 2026
Member
Author
🤖 [AI Review]
Reviewed — no findings.
Scope checked:
- Exception ordering:
ObjectDisposedExceptionis listed beforeInvalidOperationException(correct, since the former derives from the latter — otherwise it would be unreachable) - Symmetry: identical catch ladder applied to both
AudioCapture.Dispose(bool)andAudioPlayback.Dispose(bool) - No rethrow path introduced —
Dispose(bool)contract preserved (cleanup still continues withDestroy(_handle)and_isDisposed = true) - Logged catch uses
GetType().Nameas tag and$ex(full exception with stack) — sufficient for dlog forensics - Public API surface unchanged (2 files, body-only edits inside
protected virtualoverrides)
No 🔴 critical issues, no 🟡 suggestions to flag.
Automated review — final merge decision rests with human reviewers.
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.
Summary
Replaces the catch-all
catch (Exception) { }swallow pattern inAudioCaptureBase.Dispose(bool)andAudioPlayback.Dispose(bool)with a narrower set of catch clauses, so unexpected failures insideUnprepare()show up in dlog instead of disappearing.Changes
src/Tizen.Multimedia.AudioIO/AudioIO/AudioCapture.cs(Dispose(bool), around L131)src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlayback.cs(Dispose(bool), around L168)For both files the previous block:
is now:
ObjectDisposedExceptionis listed first because it derives fromInvalidOperationException(C# requires the more-derived catch first).Mode
Refactoring
Behavior & API Compatibility
Dispose(bool)signatureDispose(bool)Log.Erroris the only added side-effect for the unexpected case)Tizen.Multimedia.AudioIO(see existing usage atAudioCapture.cs:474)Verification
dotnet build src/Tizen.Multimedia.AudioIO→ 0 errors, 0 new warningsFixes #7610