diff --git a/crates/victory-gpu/src/host.rs b/crates/victory-gpu/src/host.rs index c25381b231..1bbe991eac 100644 --- a/crates/victory-gpu/src/host.rs +++ b/crates/victory-gpu/src/host.rs @@ -2528,7 +2528,7 @@ mod batch { // Batch::texture_due lives here; `mod tests` is already taken at // SAFETY: our pool, guarded since the copy took it. unsafe { ((p + PAGE + 8) as *mut u8).write_volatile(7) }; // The next submission: two lists ask for the copy. - let mut batch = Batch::default(); + batch = Batch::default(); batch.add(©, p, len); batch.add(©, p + 100, 200); assert_eq!(batch.flush(), PAGE, "the page written"); @@ -2541,6 +2541,9 @@ mod batch { // Batch::texture_due lives here; `mod tests` is already taken at batch.add(©, p, len); assert_eq!(batch.flush(), PAGE, "after a title write, what changed"); crate::shadow::unregister(p, p as u64); + // The batch holds the copy, which watches the pool: gone before the + // pool, whose addresses a test running beside this one may take. + drop(batch); drop(copy); crate::watch::tests::free(p); }