mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
Kernel: Fix leaking Timer instances
When a Timer is queued we add a reference, so whenever we remove a timer or fire it we should drop that reference. Fixes #4382
This commit is contained in:
parent
66f9a2d9ec
commit
03fcd02dfd
Notes:
sideshowbarker
2024-07-19 00:55:23 +09:00
Author: https://github.com/tomuta
Commit: 03fcd02dfd
Pull-request: https://github.com/SerenityOS/serenity/pull/4384
Issue: https://github.com/SerenityOS/serenity/issues/4382
2 changed files with 7 additions and 3 deletions
|
@ -97,7 +97,7 @@ public:
|
|||
bool cancel_timer(Timer&);
|
||||
bool cancel_timer(NonnullRefPtr<Timer>&& timer)
|
||||
{
|
||||
return cancel_timer(timer.leak_ref());
|
||||
return cancel_timer(*move(timer));
|
||||
}
|
||||
void fire();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue