Fix AudioRecorder leak and SEL5_MACRO_RANGE misparse in Logic - #816
Open
MarkRose wants to merge 1 commit into
Open
Fix AudioRecorder leak and SEL5_MACRO_RANGE misparse in Logic#816MarkRose wants to merge 1 commit into
MarkRose wants to merge 1 commit into
Conversation
- Logic::recordStart leaked the AudioRecorder when initialize() failed
(e.g. file could not be opened due to a bad path or permissions).
On the failure path it called recordStop(), which removes the
recorder from rx_splitter, but the recorder was never registered as
a splitter sink at that point (addSink() runs later, only on
success), so the removal was a no-op and the sole pointer to the
object was dropped. Now the recorder is deleted directly on the
failure path instead of relying on recordStop().
- Logic::initialize mishandled a SEL5_MACRO_RANGE config value that is
missing the required comma separator. string::find(",") returns
npos, which was cast to int and used as a substr() length/position,
silently producing sel5_from == sel5_to == the entire (malformed)
string instead of reporting the bad config. Now the missing-comma
case is detected explicitly and an error is logged instead of
silently deriving a degenerate range.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
Logic::recordStart leaked the AudioRecorder when initialize() failed
(e.g. file could not be opened due to a bad path or permissions).
On the failure path it called recordStop(), which removes the
recorder from rx_splitter, but the recorder was never registered as
a splitter sink at that point (addSink() runs later, only on
success), so the removal was a no-op and the sole pointer to the
object was dropped. Now the recorder is deleted directly on the
failure path instead of relying on recordStop().
Logic::initialize mishandled a SEL5_MACRO_RANGE config value that is
missing the required comma separator. string::find(",") returns
npos, which was cast to int and used as a substr() length/position,
silently producing sel5_from == sel5_to == the entire (malformed)
string instead of reporting the bad config. Now the missing-comma
case is detected explicitly and an error is logged instead of
silently deriving a degenerate range.
Co-Authored-By: Claude Opus 4.8 [email protected]