Print a warning for un-applied commands being dropped from a CommandQueue (#11146)

# Objective

- Fixes #11125 
## Solution

Add a warning for un-applied commands to the `drop` function.
This commit is contained in:
Chia-Hsiang Cheng 2024-01-03 23:32:57 +08:00 committed by GitHub
parent 19f5222c29
commit b6da40cfe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
use std::mem::MaybeUninit;
use bevy_ptr::{OwningPtr, Unaligned};
use bevy_utils::tracing::warn;
use super::Command;
use crate::world::World;
@ -161,6 +162,9 @@ impl CommandQueue {
impl Drop for CommandQueue {
fn drop(&mut self) {
if !self.bytes.is_empty() {
warn!("CommandQueue has un-applied commands being dropped.");
}
self.apply_or_drop_queued(None);
}
}