1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 21:17:42 +00:00

LibGUI: Unregister AbstractView from model on destruction

It was possible to leave stale view pointers in the model after a view
was destroyed while attached to a model.
This commit is contained in:
Andreas Kling 2020-09-10 18:44:10 +02:00
parent 4e0df06f86
commit e860a9aa80

View file

@ -44,6 +44,8 @@ AbstractView::AbstractView()
AbstractView::~AbstractView()
{
if (m_model)
m_model->unregister_view({}, *this);
}
void AbstractView::set_model(RefPtr<Model> model)