mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 731288 - Don't call methods on finalized SurfaceTexture, JNI housekeeping r=blassey
This commit is contained in:
parent
012f67499d
commit
3814700c00
@ -415,6 +415,19 @@ nsNPAPIPluginInstance::Start()
|
||||
// before returning. If the plugin returns failure, we'll clear it out below.
|
||||
mRunning = RUNNING;
|
||||
|
||||
#if MOZ_WIDGET_ANDROID
|
||||
// Flash creates some local JNI references during initialization (NPP_New). It does not
|
||||
// remove these references later, so essentially they are leaked. AutoLocalJNIFrame
|
||||
// prevents this by pushing a JNI frame. As a result, all local references created
|
||||
// by Flash are contained in this frame. AutoLocalJNIFrame pops the frame once we
|
||||
// go out of scope and the local references are deleted, preventing the leak.
|
||||
JNIEnv* env = AndroidBridge::GetJNIEnv();
|
||||
if (!env)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
mozilla::AutoLocalJNIFrame frame(env);
|
||||
#endif
|
||||
|
||||
nsresult newResult = library->NPP_New((char*)mimetype, &mNPP, (PRUint16)mode, count, (char**)names, (char**)values, NULL, &error);
|
||||
mInPluginInitCall = oldVal;
|
||||
|
||||
|
@ -134,17 +134,6 @@ public class SurfaceTextureLayer extends Layer implements SurfaceTexture.OnFrame
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
if (mSurfaceTexture != null) {
|
||||
try {
|
||||
SurfaceTexture.class.getDeclaredMethod("release").invoke(mSurfaceTexture);
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
Log.e(LOGTAG, "error finding release method on mSurfaceTexture", nsme);
|
||||
} catch (IllegalAccessException iae) {
|
||||
Log.e(LOGTAG, "error invoking release method on mSurfaceTexture", iae);
|
||||
} catch (Exception e) {
|
||||
Log.e(LOGTAG, "some other exception while invoking release method on mSurfaceTexture", e);
|
||||
}
|
||||
}
|
||||
if (mTextureId > 0)
|
||||
TextureReaper.get().add(mTextureId);
|
||||
} finally {
|
||||
|
Loading…
Reference in New Issue
Block a user