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:
parent
19f5222c29
commit
b6da40cfe6
@ -1,6 +1,7 @@
|
|||||||
use std::mem::MaybeUninit;
|
use std::mem::MaybeUninit;
|
||||||
|
|
||||||
use bevy_ptr::{OwningPtr, Unaligned};
|
use bevy_ptr::{OwningPtr, Unaligned};
|
||||||
|
use bevy_utils::tracing::warn;
|
||||||
|
|
||||||
use super::Command;
|
use super::Command;
|
||||||
use crate::world::World;
|
use crate::world::World;
|
||||||
@ -161,6 +162,9 @@ impl CommandQueue {
|
|||||||
|
|
||||||
impl Drop for CommandQueue {
|
impl Drop for CommandQueue {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
if !self.bytes.is_empty() {
|
||||||
|
warn!("CommandQueue has un-applied commands being dropped.");
|
||||||
|
}
|
||||||
self.apply_or_drop_queued(None);
|
self.apply_or_drop_queued(None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user