diff options
| author | Raph Levien <raph@google.com> | 2015-05-06 14:26:35 -0700 |
|---|---|---|
| committer | Raph Levien <raph@google.com> | 2015-05-06 14:26:35 -0700 |
| commit | 3bd60c7b1125ee42cd7e8746aeaebdb43e8211d8 (patch) | |
| tree | b876834fda75b83887baf9b29e84ddf19b63d4ce /core/java/android/text/StaticLayout.java | |
| parent | cf1f2ea5a7945dc4982b1e41197af94ad64e8f37 (diff) | |
| download | frameworks_base-3bd60c7b1125ee42cd7e8746aeaebdb43e8211d8.zip frameworks_base-3bd60c7b1125ee42cd7e8746aeaebdb43e8211d8.tar.gz frameworks_base-3bd60c7b1125ee42cd7e8746aeaebdb43e8211d8.tar.bz2 | |
Clear all StaticLayout.Builder fields on pool recycle
When returning a StaticLayout.Builder object to the pool, it is
important to clear everything out. If not, then the object may have
stale state from a previous layout operation. This was causing CTS
test failures and probably other mischief.
Bug: 20636917
Change-Id: I76fb20076ee954fcb476131a8fbe8833d72fbc0d
Diffstat (limited to 'core/java/android/text/StaticLayout.java')
| -rw-r--r-- | core/java/android/text/StaticLayout.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 451abea..59c7c6d 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -91,6 +91,7 @@ public class StaticLayout extends Layout { b.mEllipsizedWidth = width; b.mEllipsize = null; b.mMaxLines = Integer.MAX_VALUE; + b.mBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE; b.mMeasuredText = MeasuredText.obtain(); return b; @@ -100,6 +101,8 @@ public class StaticLayout extends Layout { b.mPaint = null; b.mText = null; MeasuredText.recycle(b.mMeasuredText); + b.mMeasuredText = null; + nFinishBuilder(b.mNativePtr); sPool.release(b); } |
