mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Rollup merge of #104401 - RalfJung:mpsc-leak, r=Amanieu
avoid memory leak in mpsc test r? ```@Amanieu```
This commit is contained in:
commit
4864a04c33
@ -713,10 +713,11 @@ fn issue_39364() {
|
||||
let t = thread::spawn(move || {
|
||||
thread::sleep(Duration::from_millis(300));
|
||||
let _ = tx.clone();
|
||||
crate::mem::forget(tx);
|
||||
// Don't drop; hand back to caller.
|
||||
tx
|
||||
});
|
||||
|
||||
let _ = rx.recv_timeout(Duration::from_millis(500));
|
||||
t.join().unwrap();
|
||||
let _tx = t.join().unwrap(); // delay dropping until end of test
|
||||
let _ = rx.recv_timeout(Duration::from_millis(500));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user