Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75af0124 authored by Vadim Caen's avatar Vadim Caen Committed by Android (Google) Code Review
Browse files

Merge "fix:exchange ownership of file descriptor for PlanesLockGuard" into main

parents d1e20428 b71bdfc2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -89,13 +89,16 @@ PlanesLockGuard::PlanesLockGuard(std::shared_ptr<AHardwareBuffer> hwBuffer,
    return;
  }

  const int32_t rawFence = fence != nullptr ? fence->get() : -1;
  const int32_t rawFence = fence != nullptr ? dup(fence->get()) : -1;
  mLockStatus = static_cast<status_t>(AHardwareBuffer_lockPlanes(
      hwBuffer.get(), usageFlags, rawFence, nullptr, &mPlanes));
  if (mLockStatus != OK) {
    ALOGE("%s: Failed to lock graphic buffer: %s", __func__,
          statusToString(mLockStatus).c_str());
  }
  if (rawFence >= 0) {
    close(rawFence);
  }
}

PlanesLockGuard::~PlanesLockGuard() {