summaryrefslogtreecommitdiff
path: root/gralloc4/src
diff options
context:
space:
mode:
authorAnkit Goyal <layog@google.com>2021-11-02 08:17:55 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-11-02 08:17:55 +0000
commit40d670ab744eabee64d7392cf86958d9b25f3d49 (patch)
treee58dfcef361ca688585ce83521931398fb1bd6d0 /gralloc4/src
parent802ae94946202ea9ec539979b2fb32adc11a7b0c (diff)
parent4ffbe198a4b30112aa2a29f709de0052750b53ca (diff)
downloadgchips-40d670ab744eabee64d7392cf86958d9b25f3d49.tar.gz
gralloc4: Delete the gralloc handle when freeing the buffer am: 4ffbe198a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/gchips/+/16074852 Change-Id: I1a9de08f6fd847c8e488aa16ee55ee1d72964d8c
Diffstat (limited to 'gralloc4/src')
-rw-r--r--gralloc4/src/allocator/mali_gralloc_ion.cpp1
-rw-r--r--gralloc4/src/core/mali_gralloc_bufferallocation.cpp2
-rw-r--r--gralloc4/src/core/mali_gralloc_reference.cpp2
3 files changed, 2 insertions, 3 deletions
diff --git a/gralloc4/src/allocator/mali_gralloc_ion.cpp b/gralloc4/src/allocator/mali_gralloc_ion.cpp
index dd003c9..4b96743 100644
--- a/gralloc4/src/allocator/mali_gralloc_ion.cpp
+++ b/gralloc4/src/allocator/mali_gralloc_ion.cpp
@@ -523,6 +523,7 @@ void mali_gralloc_ion_free(private_handle_t * const hnd)
hnd->fds[i] = -1;
hnd->bases[i] = 0;
}
+ delete hnd;
}
static void mali_gralloc_ion_free_internal(buffer_handle_t * const pHandle,
diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
index e928637..c0f1549 100644
--- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
+++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
@@ -1150,8 +1150,8 @@ int mali_gralloc_buffer_free(buffer_handle_t pHandle)
return -1;
}
- mali_gralloc_ion_free(hnd);
gralloc_shared_memory_free(hnd);
+ mali_gralloc_ion_free(hnd);
return 0;
}
diff --git a/gralloc4/src/core/mali_gralloc_reference.cpp b/gralloc4/src/core/mali_gralloc_reference.cpp
index 57b8f73..880f838 100644
--- a/gralloc4/src/core/mali_gralloc_reference.cpp
+++ b/gralloc4/src/core/mali_gralloc_reference.cpp
@@ -116,8 +116,6 @@ int mali_gralloc_reference_release(buffer_handle_t handle, bool canFree)
{
mali_gralloc_dump_buffer_erase(hnd);
mali_gralloc_buffer_free(handle);
- delete handle;
-
}
}
else if (hnd->remote_pid == getpid()) // never unmap buffers that were not imported into this process