Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09175735 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Fix bug #5344067 android.text.DynamicLayout.sStaticLayout can hold onto an...

Fix bug #5344067 android.text.DynamicLayout.sStaticLayout can hold onto an Activity, potential memory leak

- make the StaticLayout constructor not depending on the text as we just need the "generate()" call to be done

Change-Id: I65249e65ed6446b6ac13dbf8c8f58fcdf54046cb
parent 4c253119
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ extends Layout
        }

        if (reflowed == null) {
            reflowed = new StaticLayout(getText());
            reflowed = new StaticLayout(null);
        } else {
            reflowed.prepare();
        }
@@ -488,7 +488,7 @@ extends Layout

    private int mTopPadding, mBottomPadding;

    private static StaticLayout sStaticLayout = null;
    private static StaticLayout sStaticLayout = new StaticLayout(null);

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