fix: MutexGuard temporary outliving its borrow in report_swap call

if-let on a temporary lock guard without a trailing semicolon extends
the guard's drop scope past the enclosing block, so the State it
borrowed from gets dropped first -- E0597 on macOS/Windows.
This commit is contained in:
KhooLy 2026-06-17 20:18:49 +03:00
parent 11e6476c96
commit 5ca395dbbf
2 changed files with 2 additions and 2 deletions

View file

@ -442,7 +442,7 @@ pub fn install(app_handle: AppHandle) -> Result<NativePlayerSurface, String> {
let state = app.state::<DesktopState>();
if let Some(r) = state.player_renderer.lock().unwrap().as_ref() {
r.report_swap();
}
};
}
check_player_events(&app);

View file

@ -350,7 +350,7 @@ pub fn install(app_handle: AppHandle) -> Result<NativePlayerSurface, String> {
let state = app.state::<DesktopState>();
if let Some(r) = state.player_renderer.lock().unwrap().as_ref() {
r.report_swap();
}
};
}
check_player_events(&app);