mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
For bug 68532
This commit is contained in:
@ -352,7 +352,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.lockPageNumForFontsLoader(pageIndex, UpdateFontsSource.Page);
|
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
|
// 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,
|
// for text commands on other pages. After receiving ALL text pages,
|
||||||
// you need to call destroyTextInfo()
|
// you need to call destroyTextInfo()
|
||||||
@ -362,10 +373,11 @@
|
|||||||
{
|
{
|
||||||
// waiting fonts
|
// waiting fonts
|
||||||
retValue = null;
|
retValue = null;
|
||||||
|
isCrashed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null == retValue)
|
if (null == retValue)
|
||||||
return null;
|
return isCrashed ? [] : null;
|
||||||
|
|
||||||
let lenArray = new Int32Array(Module["HEAP8"].buffer, retValue, 5);
|
let lenArray = new Int32Array(Module["HEAP8"].buffer, retValue, 5);
|
||||||
let len = lenArray[0];
|
let len = lenArray[0];
|
||||||
|
|||||||
@ -432,9 +432,11 @@ namespace PdfReader
|
|||||||
|
|
||||||
if (bResult)
|
if (bResult)
|
||||||
{
|
{
|
||||||
|
#ifndef BUILDING_WASM_MODULE
|
||||||
// Шрифт нашелся, но пока им пользоваться нельзя, потому что он загружается в параллельном потоке
|
// Шрифт нашелся, но пока им пользоваться нельзя, потому что он загружается в параллельном потоке
|
||||||
while (!pEntry->bAvailable)
|
while (!pEntry->bAvailable)
|
||||||
NSThreads::Sleep(10);
|
NSThreads::Sleep(10);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
RELEASEOBJECT(pCS);
|
RELEASEOBJECT(pCS);
|
||||||
@ -449,9 +451,11 @@ namespace PdfReader
|
|||||||
|
|
||||||
if (bResult)
|
if (bResult)
|
||||||
{
|
{
|
||||||
|
#ifndef BUILDING_WASM_MODULE
|
||||||
// Шрифт нашелся, но пока им пользоваться нельзя, потому что он загружается в параллельном потоке
|
// Шрифт нашелся, но пока им пользоваться нельзя, потому что он загружается в параллельном потоке
|
||||||
while (!(*ppEntry)->bAvailable)
|
while (!(*ppEntry)->bAvailable)
|
||||||
NSThreads::Sleep(10);
|
NSThreads::Sleep(10);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bResult)
|
if (!bResult)
|
||||||
|
|||||||
Reference in New Issue
Block a user