LibCore: Remove unnecessary or invalid write after child remove

This commit is contained in:
MINAqwq 2024-03-04 11:13:17 +01:00 committed by Tim Flynn
commit e1598233e1
Notes: sideshowbarker 2024-07-17 05:03:11 +09:00

View file

@ -134,7 +134,9 @@ public:
{
if (m_parent)
m_parent->remove_child(*this);
m_parent = nullptr;
// The call to `remove_child` may have deleted the object.
// Do not dereference `this` from this point forward.
}
template<class T, class... Args>