InDesign freezes when performing a script from a uxp plugin
I ask you to help in a solution, it is not clear why the InDesign is freezing when performing the script from the UXP plugin, not at every start, but once. It can perform several functions several times well, and then it freezes on the same functions ...
After some time, such an error appears:
<system platform="Windows 11 Pro" osversion="11.0" osbuild="22621" applicationlanguage="en-us" userlanguage="ru-RU" oslanguage="en-US" ram="16104" machine="13th Gen Intel(R) Core(TM) i5-13500H" model="Intel64 Family 6 Model 186 Stepping 2" cpuCount="16" cpuType="8664" cpuFreq="3187 MHz" processorArchitecture="9"/>
<gpu>
<gpuinfo availability="Running/Full Power" adapterCompatibility="Intel Corporation" adapterRAM="1024 MB" caption="Intel(R) UHD Graphics" description="Intel(R) UHD Graphics" driverDate="20230711000000.000000-000" driverVersion="31.0.101.4575" videoModeDescription="1920 x 1080 x 4294967296 colors" pnpDeviceID="PCI\VEN_8086&DEV_A720&SUBSYS_01571558&REV_04\3&11583659&0&10" installedDisplayDrivers="<>,igd10iumd64.dll,igd12umd64.dll"/>
<gpuinfo availability="Running/Full Power" adapterCompatibility="NVIDIA" adapterRAM="4095 MB" caption="NVIDIA GeForce RTX 4060 Laptop GPU" description="NVIDIA GeForce RTX 4060 Laptop GPU" driverDate="20230912000000.000000-000" driverVersion="31.0.15.3742" videoModeDescription="1024 x 768 x 4294967296 colors" pnpDeviceID="PCI\VEN_10DE&DEV_28A0&SUBSYS_01571558&REV_A1\4&4412DE9&0&0008" installedDisplayDrivers="nvldumdx.dll"/>
</gpu>
<crash exception="EXCEPTION_ACCESS_VIOLATION" exceptionCode="0xc0000005" instruction="0x00007FFC117315ED">
