Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r270496 - [GLib] Leaked RunLoop objects on worker threads
https://bugs.webkit.org/show_bug.cgi?id=219232 <rdar://problem/71772277> Patch by Zan Dobersek <zdobersek@igalia.com> on 2020-12-07 Reviewed by Geoffrey Garen. Source/WTF: During the thread-local RunLoop::Holder destruction, explicitly clear out the iteration Deque objects on the held RunLoop, destroying any Function objects that never got to execute on this thread. Generally, this allows for any RunLoop reference stored in these objects to be released. Specifically, this would allow for destruction of the RunLoop::Timer object that's queued up in the JSRunLoopTimer::Manager::PerVMData destructor but never gets dispatched because the thread (a JS worker) is shut down before that happens. Destruction of the timer will release the reference of the RunLoop that's held by the RunLoop::Holder, finally enabling the RunLoop object itself be destroyed once the RunLoop::Holder reference is let go. * wtf/RunLoop.cpp: (WTF::RunLoop::Holder::~Holder): (WTF::RunLoop::threadWillExit): * wtf/RunLoop.h: Tools: Add a unit test covering proper RunLoop teardown upon thread destruction even if RunLoop references are stored in the dispatch queues. * TestWebKitAPI/Tests/WTF/RunLoop.cpp: (TestWebKitAPI::TEST):
- Loading branch information
1 parent
ad9d2ec
commit 7082b19
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters