d437076142
The file opened and mapped to memory in
the `xdictionary` ctor was never unmapped
and closed again, resulting in a memory leak.
For Android Viewer, this resulted in the app
running out of memory after a while when
scrolling up and down in the Chinese sample
doc from tdf#148851.
On Android, closing the file is actually the relevant part,
because the content of files from `/assets` is automatically
loaded into memory when the files are opened (s. the call to
`openMemoryAsFile` in `openFilePath` in `sal/osl/unx/file.cxx`)
and that memory is only freed when the file is closed
again (s. `osl_closeFile`).
When using the sample doc, the file in question
was "file:///assets/share/dict_zh.data", which
has a size of 2.2 MB and is therefore actually
loaded into memory anew every time, since only
files below 50 KiB are handled by the file cache
introduced in
commit
|
||
---|---|---|
.. | ||
data | ||
breakiterator_cjk.cxx | ||
breakiterator_th.cxx | ||
breakiterator_unicode.cxx | ||
breakiteratorImpl.cxx | ||
gendict.cxx | ||
xdictionary.cxx |