Merge "Clear more native pointers in finalizers" am: a5ca0ca886

am: 8521a8ff86

* commit '8521a8ff860e89ca60d530db60f58878847cf52a':
  Clear more native pointers in finalizers

Change-Id: Icca385cd603ad15ab02f2033f8652e3a8d2f6c3d
This commit is contained in:
Hans Boehm
2016-05-10 23:48:16 +00:00
committed by android-build-merger
6 changed files with 7 additions and 1 deletions

View File

@@ -163,6 +163,7 @@ public class Camera {
protected void finalize() throws Throwable {
try {
nativeDestructor();
native_instance = 0;
} finally {
super.finalize();
}

View File

@@ -40,6 +40,7 @@ public class ColorFilter {
super.finalize();
} finally {
destroyFilter(native_instance);
native_instance = 0;
}
}

View File

@@ -33,6 +33,7 @@ public class DrawFilter {
protected void finalize() throws Throwable {
try {
nativeDestructor(mNativeInt);
mNativeInt = 0;
} finally {
super.finalize();
}

View File

@@ -21,7 +21,7 @@ import java.io.InputStream;
import java.io.FileInputStream;
public class Movie {
private final long mNativeMovie;
private long mNativeMovie;
private Movie(long nativeMovie) {
if (nativeMovie == 0) {
@@ -82,6 +82,7 @@ public class Movie {
protected void finalize() throws Throwable {
try {
nativeDestructor(mNativeMovie);
mNativeMovie = 0;
} finally {
super.finalize();
}

View File

@@ -26,6 +26,7 @@ public class Rasterizer {
protected void finalize() throws Throwable {
finalizer(native_instance);
native_instance = 0;
}
private static native void finalizer(long native_instance);

View File

@@ -33,6 +33,7 @@ public class Xfermode {
protected void finalize() throws Throwable {
try {
finalizer(native_instance);
native_instance = 0;
} finally {
super.finalize();
}