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

Commit d7437d64 authored by Diego Perez's avatar Diego Perez
Browse files

Dispose font cache on bridge.dispose

Test: N/A
Change-Id: I81404740835814a018bfd70cf70b5c22933f19f5
parent 81b034d4
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@ import android.annotation.NonNull;
import android.content.res.BridgeAssetManager;
import android.content.res.BridgeAssetManager;
import android.graphics.Bitmap;
import android.graphics.Bitmap;
import android.graphics.FontFamily_Delegate;
import android.graphics.FontFamily_Delegate;
import android.graphics.Typeface;
import android.graphics.Typeface_Delegate;
import android.graphics.Typeface_Delegate;
import android.icu.util.ULocale;
import android.icu.util.ULocale;
import android.os.Looper;
import android.os.Looper;
@@ -402,6 +403,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge {


        // dispose of the default typeface.
        // dispose of the default typeface.
        Typeface_Delegate.resetDefaults();
        Typeface_Delegate.resetDefaults();
        Typeface.sDynamicTypefaceCache.evictAll();


        return true;
        return true;
    }
    }
+1 −0
Original line number Original line Diff line number Diff line
@@ -311,6 +311,7 @@ public class RenderTestBase {
        sFrameworkRepo = null;
        sFrameworkRepo = null;
        sProjectResources = null;
        sProjectResources = null;
        sLogger = null;
        sLogger = null;
        sBridge.dispose();
        sBridge = null;
        sBridge = null;


        TestUtils.gc();
        TestUtils.gc();
+2 −1
Original line number Original line Diff line number Diff line
@@ -334,7 +334,8 @@ public final class CreateInfo implements ICreateInfo {
    private final static String[] PROMOTED_FIELDS = new String[] {
    private final static String[] PROMOTED_FIELDS = new String[] {
        "android.graphics.drawable.VectorDrawable#mVectorState",
        "android.graphics.drawable.VectorDrawable#mVectorState",
        "android.view.Choreographer#mLastFrameTimeNanos",
        "android.view.Choreographer#mLastFrameTimeNanos",
        "android.graphics.FontFamily#mBuilderPtr"
        "android.graphics.FontFamily#mBuilderPtr",
        "android.graphics.Typeface#sDynamicTypefaceCache"
    };
    };


    /**
    /**