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

am: 0024c91409

* commit '0024c91409ae7c137ede27d10f67331720cede43':
  Clear more native pointers in finalizers

Change-Id: I343282660f701962241c73683023b19fdc7c7f32
This commit is contained in:
Hans Boehm
2016-05-10 23:50:40 +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();
}