зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1302189 - [1.2] Release native zip only on finalize to prevent premature unmapping of referenced memory. r=kats
This commit is contained in:
Родитель
7e70cbbbe1
Коммит
c8d15524ab
|
@ -26,8 +26,8 @@ class ByteBufferInputStream extends InputStream {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
mBuf = null;
|
// Do nothing, we need to keep the native references around for child
|
||||||
mNativeRef.release();
|
// buffers.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,10 +38,6 @@ public class NativeZip implements NativeReference {
|
||||||
release();
|
release();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() {
|
|
||||||
release();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void release() {
|
public void release() {
|
||||||
if (mObj != 0) {
|
if (mObj != 0) {
|
||||||
|
|
|
@ -66,9 +66,6 @@ public final class GeckoJarReader {
|
||||||
Log.e(LOGTAG, "Error closing stream", ex);
|
Log.e(LOGTAG, "Error closing stream", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (zip != null) {
|
|
||||||
zip.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bitmap;
|
return bitmap;
|
||||||
|
@ -97,9 +94,6 @@ public final class GeckoJarReader {
|
||||||
Log.e(LOGTAG, "Error closing reader", ex);
|
Log.e(LOGTAG, "Error closing reader", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (zip != null) {
|
|
||||||
zip.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче