CoreText crashes when run in multiple threads

后端 未结 5 1545
-上瘾入骨i
-上瘾入骨i 2021-02-04 08:32

I have a very weird problem with core text, which sometimes randomly and sometimes reproducibly crashes my application. I use it to lay out and render a couple of pages. I do th

5条回答
  •  时光取名叫无心
    2021-02-04 08:55

    Here is what the documentation says:

    Multicore Considerations: All individual functions in Core Text are thread safe. Font objects (CTFont, CTFontDescriptor, and associated objects) can be used by simultaneously by multiple operations, work queues, or threads. However, the layout objects (CTTypesetter, CTFramesetter, CTRun, CTLine, CTFrame, and associated objects) should be used in a single operation, work queue, or thread.

    So I guess there is no way around serialising calls to CTFramesetterCreateWithAttributedString.

提交回复
热议问题