summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2016-08-10 19:56:50 -0700
committer Hans Boehm <hboehm@google.com> 2016-08-10 19:56:50 -0700
commit25dfa75ee39cb75794dd0cc088769b38bc66460a (patch)
tree648e51c4fea0e36efe895ca343203a19c8db9362
parentf28f6bb2b0473154edb293cab0432c12756144e5 (diff)
Do not stack allocate RefBase object in AaptAssets::filter
Doing so is likely to trigger log messages in the future, and will hinder diagnosis of other problems. Bug: 30292538 Change-Id: I2cb8c507e43d06d4afa7e35b564416c1474c81d1
-rw-r--r--tools/aapt/AaptAssets.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index d346731e63e2..f906ca3a9f62 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -1306,8 +1306,8 @@ bail:
status_t AaptAssets::filter(Bundle* bundle)
{
- WeakResourceFilter reqFilter;
- status_t err = reqFilter.parse(bundle->getConfigurations());
+ sp<WeakResourceFilter> reqFilter(new WeakResourceFilter());
+ status_t err = reqFilter->parse(bundle->getConfigurations());
if (err != NO_ERROR) {
return err;
}
@@ -1323,12 +1323,12 @@ status_t AaptAssets::filter(Bundle* bundle)
preferredDensity = preferredConfig.density;
}
- if (reqFilter.isEmpty() && preferredDensity == 0) {
+ if (reqFilter->isEmpty() && preferredDensity == 0) {
return NO_ERROR;
}
if (bundle->getVerbose()) {
- if (!reqFilter.isEmpty()) {
+ if (!reqFilter->isEmpty()) {
printf("Applying required filter: %s\n",
bundle->getConfigurations().string());
}
@@ -1380,7 +1380,7 @@ status_t AaptAssets::filter(Bundle* bundle)
continue;
}
const ResTable_config& config(file->getGroupEntry().toParams());
- if (!reqFilter.match(config)) {
+ if (!reqFilter->match(config)) {
if (bundle->getVerbose()) {
printf("Pruning unneeded resource: %s\n",
file->getPrintableSource().string());