Bug 205387 - [CoordinatedGraphics] ThreadedDisplayRefreshMonitor is never released
Summary: [CoordinatedGraphics] ThreadedDisplayRefreshMonitor is never released
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2019-12-18 04:15 PST by Carlos Garcia Campos
Modified: 2019-12-19 01:44 PST (History)
10 users (show)

See Also:


Attachments
Patch (7.75 KB, patch)
2019-12-18 04:24 PST, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Try to fix wincairo build (7.73 KB, patch)
2019-12-19 01:11 PST, Carlos Garcia Campos
zan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2019-12-18 04:15:04 PST
The problem is that DisplayRefreshMonitorManager::createMonitorForClient() always creates a new one for RenderingUpdateScheduler because it's not notified of the window screen change. So, createDisplayRefreshMonitor() is called every time, which returns a reference of the same object, but it's added to the monitors Vector of DisplayRefreshMonitorManager and never removed from there.
Comment 1 Carlos Garcia Campos 2019-12-18 04:24:24 PST
Created attachment 385956 [details]
Patch
Comment 2 Zan Dobersek 2019-12-18 07:04:06 PST
Comment on attachment 385956 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=385956&action=review

> Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:574
> +        changeWindowScreen();

This is problematic, cause the lambda is using m_layerTreeHost which is null.
Comment 3 Carlos Garcia Campos 2019-12-19 00:24:42 PST
Comment on attachment 385956 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=385956&action=review

>> Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:574
>> +        changeWindowScreen();
> 
> This is problematic, cause the lambda is using m_layerTreeHost which is null.

This is called right after setting m_layerTreeHost, or does the lambda capture the value at the time it's declared, even when a reference is passed? It's not crashing here, for sure.
Comment 4 Carlos Garcia Campos 2019-12-19 01:11:56 PST
Created attachment 386083 [details]
Try to fix wincairo build
Comment 5 Carlos Garcia Campos 2019-12-19 01:44:59 PST
Committed r253744: <https://trac.webkit.org/changeset/253744>