Skip to content

Commit

Permalink
Check SurfaceFactory WeakPtr before dereffing resources.
Browse files Browse the repository at this point in the history
The SurfaceFactory may have been destroyed earlier, causing this to crash.

BUG=

Review URL: https://codereview.chromium.org/575223002

Cr-Commit-Position: refs/heads/master@{#295371}
  • Loading branch information
jbauman2 authored and Commit bot committed Sep 17, 2014
1 parent 7df86c9 commit 690253e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cc/surfaces/surface_aggregator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class SurfaceAggregator::RenderPassIdAllocator {
static void UnrefHelper(base::WeakPtr<SurfaceFactory> surface_factory,
const ReturnedResourceArray& resources,
BlockingTaskRunner* main_thread_task_runner) {
surface_factory->UnrefResources(resources);
if (surface_factory)
surface_factory->UnrefResources(resources);
}

RenderPassId SurfaceAggregator::RemapPassId(RenderPassId surface_local_pass_id,
Expand Down

0 comments on commit 690253e

Please sign in to comment.