Skip to content

Commit 354f7ff

Browse files
core: Address reviews
1 parent c5dfc2d commit 354f7ff

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

core/src/avm2/globals/flash/display/display_object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn initialize_for_allocator<'gc>(
5656
// automatically be removed from the orphan list by
5757
// `OrphanManager::cleanup_dead_orphans`.
5858
if let Some(movie_clip) = dobj.as_movie_clip() {
59-
movie_clip.add_as_orphan(context);
59+
context.orphan_manager.add_orphan_obj(movie_clip.into());
6060
}
6161

6262
obj.into()

core/src/display_object/movie_clip.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,14 +1949,6 @@ impl<'gc> MovieClip<'gc> {
19491949
);
19501950
}
19511951

1952-
/// Add this `MovieClip` to the global orphan list.
1953-
#[inline]
1954-
pub fn add_as_orphan(self, context: &mut UpdateContext<'gc>) {
1955-
assert!(self.is_avm2_orphan());
1956-
1957-
context.orphan_manager.add_orphan_obj(self.into());
1958-
}
1959-
19601952
/// Allocate the AVM2 side of this object.
19611953
///
19621954
/// This function does *not* call the constructor; it is intended that you
@@ -1977,7 +1969,7 @@ impl<'gc> MovieClip<'gc> {
19771969
self.set_object2(context.gc(), object);
19781970

19791971
if self.is_avm2_orphan() {
1980-
self.add_as_orphan(context);
1972+
context.orphan_manager.add_orphan_obj(self.into());
19811973
}
19821974
}
19831975

core/src/frame_lifecycle.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,21 @@ pub fn run_all_phases_avm2(context: &mut UpdateContext<'_>) {
7575
// We may still have AVM2 orphans that we need to run frames for even though
7676
// the root movie is AVM1. However, we don't run any stage phases if the
7777
// root movie is AVM1.
78-
let is_as3_root = stage.movie().is_action_script_3();
78+
let is_root_movie_as3 = stage.movie().is_action_script_3();
7979

8080
*context.frame_phase = FramePhase::Enter;
8181
OrphanManager::each_orphan_obj(context, |orphan, context| {
8282
orphan.enter_frame(context);
8383
});
84-
if is_as3_root {
84+
if is_root_movie_as3 {
8585
stage.enter_frame(context);
8686
}
8787

8888
*context.frame_phase = FramePhase::Construct;
8989
OrphanManager::each_orphan_obj(context, |orphan, context| {
9090
orphan.construct_frame(context);
9191
});
92-
if is_as3_root {
92+
if is_root_movie_as3 {
9393
stage.construct_frame(context);
9494
stage.frame_constructed(context);
9595
}
@@ -98,13 +98,13 @@ pub fn run_all_phases_avm2(context: &mut UpdateContext<'_>) {
9898
OrphanManager::each_orphan_obj(context, |orphan, context| {
9999
orphan.run_frame_scripts(context);
100100
});
101-
if is_as3_root {
101+
if is_root_movie_as3 {
102102
stage.run_frame_scripts(context);
103103
}
104104
MovieClip::run_frame_script_cleanup(context);
105105

106106
*context.frame_phase = FramePhase::Exit;
107-
if is_as3_root {
107+
if is_root_movie_as3 {
108108
stage.exit_frame(context);
109109
}
110110

0 commit comments

Comments
 (0)