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:
Alex Crichton 2014-06-09 20:57:55 -07:00
parent 0ea7aa30cc
commit 4fecc503ee

View File

@ -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() {