Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avm1: When unloading a button, also unload its children #18520

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/src/display_object/avm1_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,12 @@ impl<'gc> TDisplayObject<'gc> for Avm1Button<'gc> {
}

fn avm1_unload(&self, context: &mut UpdateContext<'gc>) {
for child in self.iter_render_list() {
child.avm1_unload(context);
}

self.drop_focus(context);

if let Some(node) = self.maskee() {
node.set_masker(context.gc(), None, true);
} else if let Some(node) = self.masker() {
Expand Down
4 changes: 4 additions & 0 deletions tests/tests/swfs/avm1/movieclip_in_removed_button/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_level0.button.instance1.onEnterFrame
_level0.button
undefined
undefined
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
num_frames = 4