@@ -345,14 +345,11 @@ pub struct ActiveTraceSpanStore(Rc<RefCell<Vec<ActiveTracingSpan>>>);
345345
346346#[ cfg( feature = "tracing" ) ]
347347impl ActiveTraceSpanStore {
348- pub fn remove_window_draw ( & self , window_id : TaoWindowId ) {
349- let mut store = self . 0 . borrow_mut ( ) ;
350- if let Some ( index) = store
351- . iter ( )
352- . position ( |t| matches ! ( t, ActiveTracingSpan :: WindowDraw { id, span: _ } if id == & window_id) )
353- {
354- store. remove ( index) ;
355- }
348+ pub fn remove_window_draw ( & self ) {
349+ self
350+ . 0
351+ . borrow_mut ( )
352+ . retain ( |t| !matches ! ( t, ActiveTracingSpan :: WindowDraw { id: _, span: _ } ) ) ;
356353 }
357354}
358355
@@ -3242,9 +3239,8 @@ fn handle_event_loop<T: UserEvent>(
32423239 callback ( RunEvent :: Exit ) ;
32433240 }
32443241
3245- #[ cfg( any ( feature = "tracing" , windows) ) ]
3242+ #[ cfg( windows) ]
32463243 Event :: RedrawRequested ( id) => {
3247- #[ cfg( windows) ]
32483244 if let Some ( window_id) = window_id_map. get ( & id) {
32493245 let mut windows_ref = windows. 0 . borrow_mut ( ) ;
32503246 if let Some ( window) = windows_ref. get_mut ( & window_id) {
@@ -3257,9 +3253,11 @@ fn handle_event_loop<T: UserEvent>(
32573253 }
32583254 }
32593255 }
3256+ }
32603257
3261- #[ cfg( feature = "tracing" ) ]
3262- active_tracing_spans. remove_window_draw ( id) ;
3258+ #[ cfg( feature = "tracing" ) ]
3259+ Event :: RedrawEventsCleared => {
3260+ active_tracing_spans. remove_window_draw ( ) ;
32633261 }
32643262
32653263 Event :: UserEvent ( Message :: Webview (
0 commit comments