Skip to content

Commit 8eb34ed

Browse files
Fabrice Di MeglioAndroid (Google) Code Review
authored andcommitted
Merge "Fix bug #5344067 android.text.DynamicLayout.sStaticLayout can hold onto an Activity, potential memory leak"
2 parents 4da465a + 0917573 commit 8eb34ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/java/android/text/DynamicLayout.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private void reflow(CharSequence s, int where, int before, int after) {
275275
}
276276

277277
if (reflowed == null) {
278-
reflowed = new StaticLayout(getText());
278+
reflowed = new StaticLayout(null);
279279
} else {
280280
reflowed.prepare();
281281
}
@@ -488,7 +488,7 @@ public int getEllipsisCount(int line) {
488488

489489
private int mTopPadding, mBottomPadding;
490490

491-
private static StaticLayout sStaticLayout = null;
491+
private static StaticLayout sStaticLayout = new StaticLayout(null);
492492

493493
private static final Object[] sLock = new Object[0];
494494

0 commit comments

Comments
 (0)