diff options
author | Conley Owens <cco3@android.com> | 2011-04-29 17:15:09 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-04-29 17:15:09 -0700 |
commit | 1eb31b434fdc325c55b65ecf1783c63b2fdfa669 (patch) | |
tree | d75fabb2e44aee1ca5ef90e12945102aeea34fc7 /graphics | |
parent | 64248af314593fe8ffed57ac9a0f43dede26bfc2 (diff) | |
parent | 718516f3b73468c480ef8d2283a1c80a6223658d (diff) | |
download | frameworks_base-1eb31b434fdc325c55b65ecf1783c63b2fdfa669.zip frameworks_base-1eb31b434fdc325c55b65ecf1783c63b2fdfa669.tar.gz frameworks_base-1eb31b434fdc325c55b65ecf1783c63b2fdfa669.tar.bz2 |
am 718516f3: am 9fd8e057: Merge "Fix memory leak of SkMovie class"
* commit '718516f3b73468c480ef8d2283a1c80a6223658d':
Fix memory leak of SkMovie class
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Movie.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Movie.java b/graphics/java/android/graphics/Movie.java index 95e9946..4a33453 100644 --- a/graphics/java/android/graphics/Movie.java +++ b/graphics/java/android/graphics/Movie.java @@ -46,6 +46,8 @@ public class Movie { public static native Movie decodeByteArray(byte[] data, int offset, int length); + private static native void nativeDestructor(int nativeMovie); + public static Movie decodeFile(String pathName) { InputStream is; try { @@ -57,6 +59,15 @@ public class Movie { return decodeTempStream(is); } + @Override + protected void finalize() throws Throwable { + try { + nativeDestructor(mNativeMovie); + } finally { + super.finalize(); + } + } + private static Movie decodeTempStream(InputStream is) { Movie moov = null; try { |