summaryrefslogtreecommitdiffstats
path: root/cpu_ref/rsCpuScript.cpp
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2015-06-27 15:45:18 -0700
committerYang Ni <yangni@google.com>2015-06-29 11:33:22 -0700
commit9844cffc8af28c4829012bc0c48f85d04b671f88 (patch)
tree9d9ddcf3ad0db087de76a37d1828f1ee9756f140 /cpu_ref/rsCpuScript.cpp
parent7427a2546ecfa904cb4e580981f0419c628fc416 (diff)
downloadandroid_frameworks_rs-9844cffc8af28c4829012bc0c48f85d04b671f88.tar.gz
android_frameworks_rs-9844cffc8af28c4829012bc0c48f85d04b671f88.tar.bz2
android_frameworks_rs-9844cffc8af28c4829012bc0c48f85d04b671f88.zip
Avoid overwriting shared library file that is open
b/21949580 Writing different contents to an existing .so file, which is currently open, may corrupt its globals and code. Choose a different file name instead. Change-Id: I3e649b09a55b43339283aa1c46f2844c66434c17
Diffstat (limited to 'cpu_ref/rsCpuScript.cpp')
-rw-r--r--cpu_ref/rsCpuScript.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index ea577bc8..bfed1f5a 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -883,15 +883,12 @@ const char* RsdCpuScriptImpl::getFieldName(uint32_t slot) const {
RsdCpuScriptImpl::~RsdCpuScriptImpl() {
#ifndef RS_COMPATIBILITY_LIB
- if (mCompilerDriver) {
- delete mCompilerDriver;
- }
+ delete mCompilerDriver;
#endif
- if (mScriptExec != nullptr) {
- delete mScriptExec;
- }
- if (mBoundAllocs) delete[] mBoundAllocs;
+ delete mScriptExec;
+
+ delete[] mBoundAllocs;
if (mScriptSO) {
dlclose(mScriptSO);
}