@@ -2492,6 +2492,14 @@ impl<'gc> MovieClip<'gc> {
2492
2492
}
2493
2493
}
2494
2494
2495
+ pub fn run_frame_script_cleanup ( context : & mut UpdateContext < ' gc > ) {
2496
+ while let Some ( clip) = context. frame_script_cleanup_queue . pop_front ( ) {
2497
+ clip. 0 . write ( context. gc ( ) ) . has_pending_script = true ;
2498
+ clip. 0 . write ( context. gc ( ) ) . last_queued_script_frame = None ;
2499
+ clip. run_local_frame_scripts ( context) ;
2500
+ }
2501
+ }
2502
+
2495
2503
fn run_local_frame_scripts ( self , context : & mut UpdateContext < ' gc > ) {
2496
2504
let mut write = self . 0 . write ( context. gc ( ) ) ;
2497
2505
let avm2_object = write. object . and_then ( |o| o. as_avm2_object ( ) ) ;
@@ -2712,23 +2720,13 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
2712
2720
}
2713
2721
2714
2722
fn run_frame_scripts ( self , context : & mut UpdateContext < ' gc > ) {
2715
- let cleans_up = context. frame_script_cleanup_queue . is_empty ( ) ;
2716
-
2717
2723
self . run_local_frame_scripts ( context) ;
2718
2724
2719
2725
if let Some ( container) = self . as_container ( ) {
2720
2726
for child in container. iter_render_list ( ) {
2721
2727
child. run_frame_scripts ( context) ;
2722
2728
}
2723
2729
}
2724
-
2725
- if cleans_up {
2726
- while let Some ( clip) = context. frame_script_cleanup_queue . pop_front ( ) {
2727
- clip. 0 . write ( context. gc ( ) ) . has_pending_script = true ;
2728
- clip. 0 . write ( context. gc ( ) ) . last_queued_script_frame = None ;
2729
- clip. run_local_frame_scripts ( context) ;
2730
- }
2731
- }
2732
2730
}
2733
2731
2734
2732
fn render_self ( & self , context : & mut RenderContext < ' _ , ' gc > ) {
0 commit comments