Skip to content

core: Set loader to cancelled if target clip is avm1_removed#23620

Merged
Dinnerbone merged 2 commits into
ruffle-rs:masterfrom
ChrisCPI:fix-avm1-load-cancel
May 10, 2026
Merged

core: Set loader to cancelled if target clip is avm1_removed#23620
Dinnerbone merged 2 commits into
ruffle-rs:masterfrom
ChrisCPI:fix-avm1-load-cancel

Conversation

@ChrisCPI
Copy link
Copy Markdown
Contributor

@ChrisCPI ChrisCPI commented May 3, 2026

Description

Fixes #23402

When calling movie_loader and movie_loader_data, it will check if the target clip has been avm1_removed(). If so, then it will set that loader's status to Cancelled and return early, preventing the loaded movie from executing.

Generally, movie_loader will detect if the clip was removed when it was removed immediately after trying to load a movie into it. Otherwise, movie_loader_data will detect it if the clip was removed in-between the time when the load started and when it finished.

Testing

3 new tests have been added, but only avm1/load_cancel_via_removemovieclip is passing. There is likely some underlying issue with unloadMovie and MovieClipLoader.unloadClip that is causing the other two to fail.

Checklist

  • I, a human, have self-reviewed this PR and fully understand the changes within.
  • I have made or updated tests where possible.
  • All of my commits are properly scoped, compile successfully, and pass all tests.
  • This PR does not make sense to split up into smaller PRs.
  • An LLM was involved in the authoring of this code.

@ChrisCPI ChrisCPI force-pushed the fix-avm1-load-cancel branch 4 times, most recently from 630fcc6 to 12ad201 Compare May 8, 2026 02:16
@ChrisCPI ChrisCPI changed the title core: Remove loader from load manager if target clip is avm1_removed core: Set loader to cancelled if target clip is avm1_removed May 8, 2026
Copy link
Copy Markdown
Contributor

@Dinnerbone Dinnerbone left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. Thanks!

Partially fixes an issue where starting a movie load on an MC, then removing that MC before the load is finished, will still run the loaded movie when it finishes.
@Dinnerbone Dinnerbone force-pushed the fix-avm1-load-cancel branch from 12ad201 to 8e9486e Compare May 9, 2026 23:09
@Dinnerbone Dinnerbone enabled auto-merge (rebase) May 10, 2026 06:19
@Dinnerbone Dinnerbone merged commit d36960d into ruffle-rs:master May 10, 2026
26 checks passed
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.

A loaded AVM1 movie will still run even after target clip has been removed

2 participants