mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 06:48:37 +00:00
fix: zero out component in destructor
This commit is contained in:
@@ -175,8 +175,11 @@ Entity::~Entity() {
|
||||
CancelAllTimers();
|
||||
CancelCallbackTimers();
|
||||
|
||||
for (const auto& component : m_Components | std::views::values) {
|
||||
if (component) delete component;
|
||||
for (auto& component : m_Components | std::views::values) {
|
||||
if (component) {
|
||||
delete component;
|
||||
component = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto* const child : m_ChildEntities) {
|
||||
|
Reference in New Issue
Block a user