Skip to content

make brief_stage non-copyable and non-movable; provide swap() and reset()#7557

Merged
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/brief_stage_move
Jul 8, 2026
Merged

make brief_stage non-copyable and non-movable; provide swap() and reset()#7557
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/brief_stage_move

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

brief_stage owns its icons and lines buffers through raw pointers, so the implicitly generated copy/move operations silently alias those buffers across two stages. Delete them and provide a custom swap() that exchanges members (keeping each slot with a distinct buffer), plus a reset() that restores the default-constructed state.

Update brief_compact_stages, the only code that assigned brief_stage objects: shift stages down by swapping (equivalent, since the removed stage buffers were already freed and the tail is cleared afterward) and clear the tail entries with reset().

…et()

brief_stage owns its icons and lines buffers through raw pointers, so the
implicitly generated copy/move operations silently alias those buffers
across two stages.  Delete them and provide a custom swap() that
exchanges members (keeping each slot with a distinct buffer), plus a
reset() that restores the default-constructed state.

Update brief_compact_stages, the only code that assigned brief_stage
objects: shift stages down by swapping (equivalent, since the removed
stage buffers were already freed and the tail is cleared afterward) and
clear the tail entries with reset().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Goober5000 Goober5000 added cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. labels Jul 2, 2026
@wookieejedi wookieejedi added the Point Release Candidate An already merged bugfix that may be merged into a previous stable version label Jul 5, 2026
@wookieejedi wookieejedi added this to the 26.0.1 milestone Jul 6, 2026
@Goober5000 Goober5000 merged commit 2fc4ff1 into scp-fs2open:master Jul 8, 2026
20 checks passed
@Goober5000 Goober5000 deleted the fix/brief_stage_move branch July 8, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. Point Release Candidate An already merged bugfix that may be merged into a previous stable version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants