Commit a85150fb authored by James Darpinian's avatar James Darpinian Committed by Commit Bot

Don't crash if TransferBuffer::Free is called reentrantly.

Bug: 1084495
Change-Id: Iecf9fdc4a60f6e5639bd4a8b5ca465f183b80eb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390961Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805068}
parent 5bcdaef6
......@@ -61,6 +61,11 @@ void TransferBuffer::Free() {
TRACE_EVENT0("gpu", "TransferBuffer::Free");
helper_->OrderingBarrier();
helper_->command_buffer()->DestroyTransferBuffer(buffer_id_);
if (!HaveBuffer()) {
// The above may call this function reentrantly. If the buffer was
// already freed, then our work is done.
return;
}
buffer_id_ = -1;
buffer_ = nullptr;
result_buffer_ = nullptr;
......
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