summaryrefslogtreecommitdiffstats
path: root/libunwindstack/DexFiles.cpp
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2018-12-19 00:09:41 +0000
committerMartin Stjernholm <mast@google.com>2018-12-19 00:11:04 +0000
commitcacf5bf6bca7e9806739a27589d8b6101c567c32 (patch)
tree0dbf54f3f0647596c5dc00bca91c67a85aed35c7 /libunwindstack/DexFiles.cpp
parent8fd4435d532846b46fe47e52a6825a050d1af13c (diff)
downloadsystem_core-cacf5bf6bca7e9806739a27589d8b6101c567c32.tar.gz
system_core-cacf5bf6bca7e9806739a27589d8b6101c567c32.tar.bz2
system_core-cacf5bf6bca7e9806739a27589d8b6101c567c32.zip
Revert "Use libdexfile external API in libunwindstack."
This reverts commit 444e23d2fc6d7c6f799ff9e2f69c1a82d2960c5b. The rest of the topic doesn't need to be reverted. Reason for revert: Breaks renderscript on marlin and sailfish. Test: Manual repro of http://b/121110092#comment1 on reported branch Test: "atest CtsRenderscriptTestCases" on that branch Test: mmma system/core/{libunwindstack,libbacktrace}, run host gtests Test: Make image, flash, and reboot device. Bug: 121110092, 119632407 Change-Id: If1976b19ce386c95bc5bd4fd6d523745c167de18
Diffstat (limited to 'libunwindstack/DexFiles.cpp')
-rw-r--r--libunwindstack/DexFiles.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/libunwindstack/DexFiles.cpp b/libunwindstack/DexFiles.cpp
index 63a77e50f..451a0b90d 100644
--- a/libunwindstack/DexFiles.cpp
+++ b/libunwindstack/DexFiles.cpp
@@ -48,7 +48,11 @@ DexFiles::DexFiles(std::shared_ptr<Memory>& memory) : Global(memory) {}
DexFiles::DexFiles(std::shared_ptr<Memory>& memory, std::vector<std::string>& search_libs)
: Global(memory, search_libs) {}
-DexFiles::~DexFiles() {}
+DexFiles::~DexFiles() {
+ for (auto& entry : files_) {
+ delete entry.second;
+ }
+}
void DexFiles::ProcessArch() {
switch (arch()) {
@@ -133,11 +137,10 @@ DexFile* DexFiles::GetDexFile(uint64_t dex_file_offset, MapInfo* info) {
DexFile* dex_file;
auto entry = files_.find(dex_file_offset);
if (entry == files_.end()) {
- std::unique_ptr<DexFile> new_dex_file = DexFile::Create(dex_file_offset, memory_.get(), info);
- dex_file = new_dex_file.get();
- files_[dex_file_offset] = std::move(new_dex_file);
+ dex_file = DexFile::Create(dex_file_offset, memory_.get(), info);
+ files_[dex_file_offset] = dex_file;
} else {
- dex_file = entry->second.get();
+ dex_file = entry->second;
}
return dex_file;
}