mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-10-05 20:48:58 +03:00
fix(tauri-runtime-wry): window draw span not closing (#9717)
* fix(tauri-runtime-wry): window draw span not closing * use .retain
This commit is contained in:
parent
fedca73860
commit
c0bcc6c0b7
5
.changes/fix-draw-tracing.md
Normal file
5
.changes/fix-draw-tracing.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-runtime-wry": patch:bug
|
||||
---
|
||||
|
||||
Fixes redraw tracing span not closing.
|
@ -345,14 +345,11 @@ pub struct ActiveTraceSpanStore(Rc<RefCell<Vec<ActiveTracingSpan>>>);
|
||||
|
||||
#[cfg(feature = "tracing")]
|
||||
impl ActiveTraceSpanStore {
|
||||
pub fn remove_window_draw(&self, window_id: TaoWindowId) {
|
||||
let mut store = self.0.borrow_mut();
|
||||
if let Some(index) = store
|
||||
.iter()
|
||||
.position(|t| matches!(t, ActiveTracingSpan::WindowDraw { id, span: _ } if id == &window_id))
|
||||
{
|
||||
store.remove(index);
|
||||
}
|
||||
pub fn remove_window_draw(&self) {
|
||||
self
|
||||
.0
|
||||
.borrow_mut()
|
||||
.retain(|t| !matches!(t, ActiveTracingSpan::WindowDraw { id: _, span: _ }));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3242,9 +3239,8 @@ fn handle_event_loop<T: UserEvent>(
|
||||
callback(RunEvent::Exit);
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "tracing", windows))]
|
||||
#[cfg(windows)]
|
||||
Event::RedrawRequested(id) => {
|
||||
#[cfg(windows)]
|
||||
if let Some(window_id) = window_id_map.get(&id) {
|
||||
let mut windows_ref = windows.0.borrow_mut();
|
||||
if let Some(window) = windows_ref.get_mut(&window_id) {
|
||||
@ -3257,9 +3253,11 @@ fn handle_event_loop<T: UserEvent>(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "tracing")]
|
||||
active_tracing_spans.remove_window_draw(id);
|
||||
#[cfg(feature = "tracing")]
|
||||
Event::RedrawEventsCleared => {
|
||||
active_tracing_spans.remove_window_draw();
|
||||
}
|
||||
|
||||
Event::UserEvent(Message::Webview(
|
||||
|
Loading…
Reference in New Issue
Block a user