For bug 68532

This commit is contained in:
Oleg Korshul
2024-07-08 01:53:47 +03:00
parent f70b5c0939
commit 4f0e3504d1
2 changed files with 18 additions and 2 deletions

View File

@ -352,7 +352,18 @@
}
this.lockPageNumForFontsLoader(pageIndex, UpdateFontsSource.Page);
let retValue = Module["_GetGlyphs"](this.nativeFile, pageIndex);
let isCrashed = false;
let retValue = null;
try
{
retValue = Module["_GetGlyphs"](this.nativeFile, pageIndex);
}
catch (err)
{
retValue = null;
isCrashed = true;
}
// there is no need to delete the result; this buffer is used as a text buffer
// for text commands on other pages. After receiving ALL text pages,
// you need to call destroyTextInfo()
@ -362,10 +373,11 @@
{
// waiting fonts
retValue = null;
isCrashed = false;
}
if (null == retValue)
return null;
return isCrashed ? [] : null;
let lenArray = new Int32Array(Module["HEAP8"].buffer, retValue, 5);
let len = lenArray[0];

View File

@ -432,9 +432,11 @@ namespace PdfReader
if (bResult)
{
#ifndef BUILDING_WASM_MODULE
// Шрифт нашелся, но пока им пользоваться нельзя, потому что он загружается в параллельном потоке
while (!pEntry->bAvailable)
NSThreads::Sleep(10);
#endif
}
RELEASEOBJECT(pCS);
@ -449,9 +451,11 @@ namespace PdfReader
if (bResult)
{
#ifndef BUILDING_WASM_MODULE
// Шрифт нашелся, но пока им пользоваться нельзя, потому что он загружается в параллельном потоке
while (!(*ppEntry)->bAvailable)
NSThreads::Sleep(10);
#endif
}
if (!bResult)