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:
parent
4e0df06f86
commit
e860a9aa80
1 changed files with 2 additions and 0 deletions
|
@ -44,6 +44,8 @@ AbstractView::AbstractView()
|
|||
|
||||
AbstractView::~AbstractView()
|
||||
{
|
||||
if (m_model)
|
||||
m_model->unregister_view({}, *this);
|
||||
}
|
||||
|
||||
void AbstractView::set_model(RefPtr<Model> model)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue