Bug 219591 - [WTF] RunLoop::dispatchAfter() leaks pending timers after thread termination
Summary: [WTF] RunLoop::dispatchAfter() leaks pending timers after thread termination
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-07 01:18 PST by Zan Dobersek
Modified: 2021-01-20 07:39 PST (History)
3 users (show)

See Also:


Attachments
Unit test (779 bytes, patch)
2020-12-07 01:19 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2020-12-07 01:18:23 PST
Spun from  bug #219232.

Any task queued via RunLoop::dispatchAfter() is leaked if the RunLoop thread terminates before the underlying DispatchTimer is fired because the DispatchTimer is only freed when it's fired, which doesn't happen after the RunLoop thread terminates.

Right now, the RunLoop reference taken via TimerBase (from which DispatchTimer derives) also blocks the RunLoop object to be destroyed once the thread is terminated. Bug #219232 doesn't help here because DispatchTimer instances are not stored in any containers that could be cleared at the point of termination.
Comment 1 Zan Dobersek 2020-12-07 01:19:24 PST
Created attachment 415538 [details]
Unit test
Comment 2 Radar WebKit Bug Importer 2020-12-14 01:19:18 PST
<rdar://problem/72288000>