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