Skip to content

Fix AudioRecorder leak and SEL5_MACRO_RANGE misparse in Logic - #816

Open
MarkRose wants to merge 1 commit into
sm0svx:masterfrom
MarkRose:fix-logic-init-and-timer-cleanup
Open

Fix AudioRecorder leak and SEL5_MACRO_RANGE misparse in Logic#816
MarkRose wants to merge 1 commit into
sm0svx:masterfrom
MarkRose:fix-logic-init-and-timer-cleanup

Conversation

@MarkRose

Copy link
Copy Markdown
Contributor
  • 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]

- 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]>
@MarkRose MarkRose closed this Jul 12, 2026
@MarkRose MarkRose reopened this Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant