Skip to content

Fix crash deselecting moved pixels when using certain extensions#5292

Merged
dacap merged 1 commit into
aseprite:mainfrom
dacap:fix-timelapse-extension
Jul 23, 2025
Merged

Fix crash deselecting moved pixels when using certain extensions#5292
dacap merged 1 commit into
aseprite:mainfrom
dacap:fix-timelapse-extension

Conversation

@dacap

@dacap dacap commented Jul 22, 2025

Copy link
Copy Markdown
Member

Fix #5280

@aseprite-bot

Copy link
Copy Markdown
Collaborator

Hi there!

One or more of the commit messages in this PR do not match our code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@aseprite-bot aseprite-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/app/ui/editor/editor_state.h Outdated
class EditorState {
public:
enum LeaveAction { DiscardState, KeepState };
enum LeaveAction { DiscardState, KeepState, IgnoreReentryState };

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'LeaveAction' uses a larger base type ('unsigned int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

  enum LeaveAction { DiscardState, KeepState, IgnoreReentryState };
       ^

@Gasparoken

Copy link
Copy Markdown
Member

It works great with Selections. The same should be added for WritingTextState::onLeaveState which has the same problem.

@Gasparoken Gasparoken assigned dacap and unassigned Gasparoken Jul 23, 2025
@dacap

dacap commented Jul 23, 2025

Copy link
Copy Markdown
Member Author

It works great with Selections. The same should be added for WritingTextState::onLeaveState which has the same problem.

Nice catch, it looks like MovingSelectionState::onLeaveState needs the same too.

…seprite#5280)

Although the issue refers to deselecting MovingPixelsState, the same
crash could happen when canceling/finishing WritingTextState or
MovingSelectionState. This fixes the crash for all these states.
@dacap dacap force-pushed the fix-timelapse-extension branch from 0b0509d to 2ba051b Compare July 23, 2025 22:01
@aseprite-bot

Copy link
Copy Markdown
Collaborator

clang-tidy review says "All clean, LGTM! 👍"

@dacap dacap merged commit 2ba051b into aseprite:main Jul 23, 2025
11 of 12 checks passed
@dacap dacap deleted the fix-timelapse-extension branch July 23, 2025 22:17
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.

Crash using timelapse extension after deselecting

3 participants