mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 14:50:18 +00:00
SystemMonitor: Register ProcessStateModel with ProcessModel on construct
Since this was missing, ProcessStateModel never received model_did_update, and it was possible for the ProcessModel index to go stale and show another process. Fixes #9129.
This commit is contained in:
parent
cf4bd4e4c9
commit
eb6cf00c0e
Notes:
sideshowbarker
2024-07-18 07:38:38 +09:00
Author: https://github.com/sin-ack
Commit: eb6cf00c0e
Pull-request: https://github.com/SerenityOS/serenity/pull/9132
Issue: https://github.com/SerenityOS/serenity/issues/9129
1 changed files with 6 additions and 1 deletions
|
@ -23,9 +23,14 @@ public:
|
|||
: m_target(target)
|
||||
, m_pid(pid)
|
||||
{
|
||||
m_target.register_client(*this);
|
||||
refresh();
|
||||
}
|
||||
virtual ~ProcessStateModel() override { }
|
||||
|
||||
virtual ~ProcessStateModel() override
|
||||
{
|
||||
m_target.unregister_client(*this);
|
||||
}
|
||||
|
||||
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return m_target.column_count({}); }
|
||||
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return 2; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue