Should I call SurfaceTexture.release() In the finalize()

45 views
Skip to first unread message

Qing PAN

unread,
Aug 27, 2015, 7:05:14 AM8/27/15
to android-platform
Hi, every one.

I got a crash, non reproductive, in the thread FinalizerDaemon
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x41c. 

After several days of searching into the code of AOSP, i realised it is due to the call of SurfaceTexture.release() in the finalize() methode of my class who uses the SurfeceTexture to show a video in OpenGL scene.

My question is if I do not call SurfaceTexture.release(), may I got a memory leaks?

Second question, why in the code

static void SurfaceTexture_release(JNIEnv* env, jobject thiz)

{

    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));

    surfaceTexture->abandon();

}


Why do not check surfaceTexture is null or not, before use it?


Best regards

shixin chen

unread,
Nov 12, 2015, 10:06:09 AM11/12/15
to android-platform
Hi, have you solved your problem, I have met the same crash.

在 2015年8月27日星期四 UTC+8下午7:05:14,Qing PAN写道:
Reply all
Reply to author
Forward
0 new messages