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