mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 22:00:03 -04:00
egui_kittest: Close debug_open_snapshot temp file before viewing it (#7841)
The image file written by debug_open_snapshot was being kept open by the `tempfile` object. On Windows, this prevented `open::that` from successfully launching the viewer sometimes because the file remained locked, which can be avoided by first releasing the file handle.
This commit is contained in:
committed by
GitHub
parent
83e61c6fb0
commit
fa78d25564
@@ -721,11 +721,14 @@ impl<State> Harness<'_, State> {
|
|||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
// Close temp file so it isn't locked when `open` tries to launch it (on Windows)
|
||||||
|
let path = temp_file.into_temp_path();
|
||||||
|
|
||||||
#[expect(clippy::print_stdout)]
|
#[expect(clippy::print_stdout)]
|
||||||
{
|
{
|
||||||
println!("Wrote debug snapshot to: {}", path.display());
|
println!("Wrote debug snapshot to: {}", path.display());
|
||||||
}
|
}
|
||||||
let result = open::that(path);
|
let result = open::that(&path);
|
||||||
if let Err(err) = result {
|
if let Err(err) = result {
|
||||||
#[expect(clippy::print_stderr)]
|
#[expect(clippy::print_stderr)]
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user