fenster icon indicating copy to clipboard operation
fenster copied to clipboard

release() the Surface?

Open commonsguy opened this issue 9 years ago • 1 comments

I am seeing StrictMode complaints coming from FensterVideoView, in version 0.0.2 of your library:

E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
              java.lang.Throwable: Explicit termination method 'release' not called
                  at dalvik.system.CloseGuard.open(CloseGuard.java:180)
                  at android.view.Surface.setNativeObjectLocked(Surface.java:459)
                  at android.view.Surface.<init>(Surface.java:145)
                  at com.malmstein.fenster.view.FensterVideoView.openVideo(FensterVideoView.java:260)
                  at com.malmstein.fenster.view.FensterVideoView.access$2100(FensterVideoView.java:50)
                  at com.malmstein.fenster.view.FensterVideoView$8.onSurfaceTextureAvailable(FensterVideoView.java:553)

This appears to be coming from mMediaPlayer.setSurface(new Surface(mSurfaceTexture)). I do not see where you are releasing that Surface.

Thanks!

commonsguy avatar Mar 17 '16 20:03 commonsguy

Thanks for opening this @commonsguy, I'll take a look asap!

malmstein avatar Mar 20 '16 21:03 malmstein