Merge "Log a warning when a MediaPlayer is finalized without having being released. b/5382634"

This commit is contained in:
Marco Nelissen
2011-09-28 09:41:12 -07:00
committed by Android (Google) Code Review

View File

@@ -651,6 +651,10 @@ static void
android_media_MediaPlayer_native_finalize(JNIEnv *env, jobject thiz) android_media_MediaPlayer_native_finalize(JNIEnv *env, jobject thiz)
{ {
LOGV("native_finalize"); LOGV("native_finalize");
sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
if (mp != NULL) {
LOGW("MediaPlayer finalized without being released");
}
android_media_MediaPlayer_release(env, thiz); android_media_MediaPlayer_release(env, thiz);
} }