Skip to content

Commit

Permalink
Add a warning for un-applied commands being dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
garychia committed Dec 30, 2023
1 parent 8067e46 commit 4ad75de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bevy_ecs/src/system/commands/command_queue.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 4ad75de

Please sign in to comment.