wrap Payloads that are dropped eraly in ManuallyDrop

This commit is contained in:
Bennet Bleßmann
2024-07-07 15:21:08 +02:00
parent a0d790445d
commit 1b19ae81d5
4 changed files with 62 additions and 41 deletions

View File

@@ -6737,12 +6737,8 @@ impl Machine {
(HeapCellValueTag::Cons, cons_ptr) => {
match_untyped_arena_ptr!(cons_ptr,
(ArenaHeaderTag::TcpListener, tcp_listener) => {
unsafe {
// dropping closes the instance.
std::ptr::drop_in_place(&mut tcp_listener as *mut _);
}
tcp_listener.drop_payload();
tcp_listener.set_tag(ArenaHeaderTag::Dropped);
return Ok(());
}
_ => {