diff options
author | James Dong <jdong@google.com> | 2010-06-09 10:19:33 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-06-09 11:27:03 -0700 |
commit | 457d5ae3c9e40c8336b65ea954d1bd5ae1622917 (patch) | |
tree | a0ea88027983058036e1259ce13423afa3154b26 /media/jni | |
parent | 55f8209da3048768a6dc24929dec8798e8ddf077 (diff) | |
download | frameworks_base-457d5ae3c9e40c8336b65ea954d1bd5ae1622917.zip frameworks_base-457d5ae3c9e40c8336b65ea954d1bd5ae1622917.tar.gz frameworks_base-457d5ae3c9e40c8336b65ea954d1bd5ae1622917.tar.bz2 |
Fix a potential(observed sometimes) media server crash
The problem is that we are referring an temp object returned from a function call.
When the function call returned, the temp object is gone; and thus the reference
may be invalidated.
-- rebased
bug - 2734946
Change-Id: I1993c4462df95610ca478f816adc30058af5850e
Diffstat (limited to 'media/jni')
-rw-r--r-- | media/jni/android_media_MediaRecorder.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/media/jni/android_media_MediaRecorder.cpp b/media/jni/android_media_MediaRecorder.cpp index 3d90650..c113ffe 100644 --- a/media/jni/android_media_MediaRecorder.cpp +++ b/media/jni/android_media_MediaRecorder.cpp @@ -317,7 +317,7 @@ android_media_MediaRecorder_prepare(JNIEnv *env, jobject thiz) jobject surface = env->GetObjectField(thiz, fields.surface); if (surface != NULL) { - const sp<Surface>& native_surface = get_surface(env, surface); + const sp<Surface> native_surface = get_surface(env, surface); LOGI("prepare: surface=%p (identity=%d)", native_surface.get(), native_surface->getIdentity()); if (process_media_recorder_call(env, mr->setPreviewSurface(native_surface), "java/lang/RuntimeException", "setPreviewSurface failed.")) { return; |