Bug 205387

Summary: [CoordinatedGraphics] ThreadedDisplayRefreshMonitor is never released
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, cmarcelo, ews-watchlist, gyuyoung.kim, luiz, noam, ryuan.choi, sergio, zan, zeno
Priority: P2 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Try to fix wincairo build zan: review+

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>