Commit b4d73fd6 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Fix crash in SysmemBufferCollection destructor.

Previously SysmemBufferCollection could crash if it failed to initialize
(e.g. due to Allocator interface missing).

Change-Id: I72f83ebe7ad858ab908ad42fb08aeff895327c67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614001
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660928}
parent e49a1b3d
...@@ -362,7 +362,8 @@ SysmemBufferCollection::~SysmemBufferCollection() { ...@@ -362,7 +362,8 @@ SysmemBufferCollection::~SysmemBufferCollection() {
nullptr); nullptr);
} }
collection_->Close(); if (collection_)
collection_->Close();
if (on_deleted_) if (on_deleted_)
std::move(on_deleted_).Run(); std::move(on_deleted_).Run();
......
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