Commit b2998c3d authored by akaba's avatar akaba Committed by Commit Bot

Surface should clear it's observed sinks on deletion

This CL will force a surface to clear it's observed sinks when it gets
garbage collected. This should fix the memory leak problem.

Bug: 876884
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I957fa212053649bf095925f9e7a7da7cdc218829
Reviewed-on: https://chromium-review.googlesource.com/1185874
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585654}
parent 5a9e7de8
......@@ -46,6 +46,10 @@ Surface::~Surface() {
UnrefFrameResourcesAndRunCallbacks(std::move(pending_frame_data_));
UnrefFrameResourcesAndRunCallbacks(std::move(active_frame_data_));
// Remove this surface as an observer.
for (const FrameSinkId& sink_id : observed_sinks_)
surface_manager_->RemoveActivationObserver(sink_id, surface_info_.id());
if (deadline_)
deadline_->Cancel();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment