diff options
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/mm/cros_camera_buffer.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp index ec45e04c..86770135 100644 --- a/src/android/mm/cros_camera_buffer.cpp +++ b/src/android/mm/cros_camera_buffer.cpp @@ -73,10 +73,20 @@ CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer, CameraBuffer::Private::~Private() { - if (mapped_) - bufferManager_->Unlock(handle_); - if (registered_) - bufferManager_->Deregister(handle_); + int ret; + if (mapped_) { + ret = bufferManager_->Unlock(handle_); + if (ret != 0) + LOG(HAL, Error) << "Failed to unlock buffer: " + << strerror(-ret); + } + + if (registered_) { + ret = bufferManager_->Deregister(handle_); + if (ret != 0) + LOG(HAL, Error) << "Failed to deregister buffer: " + << strerror(-ret); + } } unsigned int CameraBuffer::Private::numPlanes() const |