mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Fix memory leak in world's command queue (#15295)
# Objective - I was running miri locally to check the UB in #15276 and it detected an unrelated memory leak, due to the `RawCommandQueue` changes. (I probably should have turned the leak detection off because we do purposely leak interned string labels and I assume that's why CI didn't detect it.) ## Solution - The memory allocated to `RawCommandQueue` needs to be manually dropped. This was being done for `bytes` and `cursor`, but was missed for `panic_recovery`. ## Testing - Ran miri locally and the related memory leaks errors when away.
This commit is contained in:
parent
28597e4082
commit
7ad27f4759
1 changed files with 2 additions and 0 deletions
|
@ -162,6 +162,8 @@ impl Drop for World {
|
|||
drop(unsafe { Box::from_raw(self.command_queue.bytes.as_ptr()) });
|
||||
// SAFETY: Pointers in internal command queue are only invalidated here
|
||||
drop(unsafe { Box::from_raw(self.command_queue.cursor.as_ptr()) });
|
||||
// SAFETY: Pointers in internal command queue are only invalidated here
|
||||
drop(unsafe { Box::from_raw(self.command_queue.panic_recovery.as_ptr()) });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue