rustrt: Fix invalid reads caught by valgrind
This is another case of #13246. The RAII lock wasn't being destroyed until after the allocation was free'd due to destructor scheduling. Closes #14784
This commit is contained in:
parent
0ea7aa30cc
commit
4fecc503ee
@ -54,7 +54,8 @@ pub fn run() {
|
||||
rtassert!(queue != 0);
|
||||
|
||||
let queue: Box<Queue> = mem::transmute(queue);
|
||||
mem::replace(&mut *queue.lock(), Vec::new())
|
||||
let v = mem::replace(&mut *queue.lock(), Vec::new());
|
||||
v
|
||||
};
|
||||
|
||||
for to_run in cur.move_iter() {
|
||||
|
Loading…
Reference in New Issue
Block a user