diff options
author | Romain Guy <romainguy@curious-creature.com> | 2015-04-07 10:39:45 -0700 |
---|---|---|
committer | Romain Guy <romainguy@curious-creature.com> | 2015-04-07 11:07:05 -0700 |
commit | b3a9bc038d3a218b1dbdf7b5668e3d6c12be5ee4 (patch) | |
tree | ffa92f6c022f931e2400504cb313458a34ea8d13 /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | d95e58cb609228c4c4b231e00d6bb648e9dcaf71 (diff) |
Prevent possible memory leak in SpanSet
If SpanSet.init() is called several times in a row with different
values, it is possible to change "numberOfSpans" in a way that
will prevent SpanSet.recycle() from nulling out all the spans.
This can lead to memory leaks of large objects through spans
references. User @piwai reported this leak:
com.squareup.marketfont.MarketSpan
`-[1] of array android.text.style.CharacterStyle[]
`-spans of object android.text.SpanSet
`-mCharacterStyleSpanSet of object android.text.TextLine
`-[1] of array android.text.TextLine[]
`-sCached of class android.text.TextLine
The MarketSpan instance is kept alive through a recycled TextLine
which itself contains a SpanSet.
Change-Id: Idfb2233ca16895dbe735c312662eaf0b4a2ecd65
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions