exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.01k stars 554 forks source link

Support convert to native image from Operation queue background thread #672

Closed pnghitink33b closed 4 years ago

amarunko commented 4 years ago

Hi, @pnghitink33b , what's wrong with the current realization? As I know it is work from any thread too. Please, correct me if I wrong.

pnghitink33b commented 4 years ago

Hello @amarunko, On iOS, I use concurrent NSOperation to convert multiple svg to UIImage At same time and MGraphicsGetCurrentContext()! return nil.

CGMapping.swift line 143

Screen Shot 2020-02-27 at 3 17 02 PM
amarunko commented 4 years ago

Size != .zero?

pnghitink33b commented 4 years ago

Ah, reason it crash is size equal to zero. I wrong. Thanks you. And I think call render.dispose method after draw will reduce memory usage, right?

amarunko commented 4 years ago

According to previous logic - all will be destroyed on deinit method. I think it is not needed, did you check on memory leaks?