summaryrefslogtreecommitdiff
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
commit7ff0eb4617d1e7f024b54f523b63b34483959ca9 (patch)
tree847c90fc56fb4fd59d53fc792c95d1b0c0b38d9e
parent4a222191824349d125db714c281b9c09d88c2d0a (diff)
parent4ffbe198a4b30112aa2a29f709de0052750b53ca (diff)
downloadgchips-7ff0eb4617d1e7f024b54f523b63b34483959ca9.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: I09155ca85758929e02b00adeb9ed5b272e11f2de
-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