Sdk/Entity: Fix entity destruction not calling Component::OnDetached
This commit is contained in:
parent
1a677387d1
commit
4df5ec776c
|
|
@ -158,11 +158,16 @@ namespace Ndk
|
||||||
}
|
}
|
||||||
m_systemBits.Clear();
|
m_systemBits.Clear();
|
||||||
|
|
||||||
UnregisterAllHandles();
|
// We properly destroy each component
|
||||||
|
for (std::size_t i = m_componentBits.FindFirst(); i != m_componentBits.npos; i = m_componentBits.FindNext(i))
|
||||||
|
m_components[i]->SetEntity(nullptr);
|
||||||
|
|
||||||
m_components.clear();
|
m_components.clear();
|
||||||
m_componentBits.Reset();
|
m_componentBits.Reset();
|
||||||
|
|
||||||
|
// And then free every handle
|
||||||
|
UnregisterAllHandles();
|
||||||
|
|
||||||
m_valid = false;
|
m_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue