Merge "Hold a ClassLoader reference in NativeAllocationRegistry." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8e96faae78
@@ -133,7 +133,7 @@ public final class Bitmap implements Parcelable {
|
|||||||
nativeSize += getByteCount();
|
nativeSize += getByteCount();
|
||||||
}
|
}
|
||||||
NativeAllocationRegistry registry = new NativeAllocationRegistry(
|
NativeAllocationRegistry registry = new NativeAllocationRegistry(
|
||||||
nativeGetNativeFinalizer(), nativeSize);
|
Bitmap.class.getClassLoader(), nativeGetNativeFinalizer(), nativeSize);
|
||||||
registry.registerNativeAllocation(this, nativeBitmap);
|
registry.registerNativeAllocation(this, nativeBitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class Canvas {
|
|||||||
// Use a Holder to allow static initialization of Canvas in the boot image.
|
// Use a Holder to allow static initialization of Canvas in the boot image.
|
||||||
private static class NoImagePreloadHolder {
|
private static class NoImagePreloadHolder {
|
||||||
public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry(
|
public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry(
|
||||||
getNativeFinalizer(), NATIVE_ALLOCATION_SIZE);
|
Canvas.class.getClassLoader(), getNativeFinalizer(), NATIVE_ALLOCATION_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This field is used to finalize the native Canvas properly
|
// This field is used to finalize the native Canvas properly
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class Paint {
|
|||||||
// Use a Holder to allow static initialization of Paint in the boot image.
|
// Use a Holder to allow static initialization of Paint in the boot image.
|
||||||
private static class NoImagePreloadHolder {
|
private static class NoImagePreloadHolder {
|
||||||
public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry(
|
public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry(
|
||||||
nGetNativeFinalizer(), NATIVE_PAINT_SIZE);
|
Paint.class.getClassLoader(), nGetNativeFinalizer(), NATIVE_PAINT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user