exyte / Macaw

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

Random deadlock that happens once in a while #683

Open esapir opened 4 years ago

esapir commented 4 years ago

Since latest version (0.9.6) we noticed that sometimes there is a deadlock in Macaw. I am attaching a snapshot of the stack when pausing the application below. We have no idea why it might happen and would be happy if you guys could take a look at it.

Screen Shot 2020-05-04 at 16 39 14

f3dm76 commented 4 years ago

@esapir Never happened for us, so could you please provide more details? Are you rendering an svg? Could you attach it? Or create a minimal example where this reproduces? Are you doing something special when this happens, like animating or tracking mouse movements? Looks like it happens in applyEffects method, is it always in this method? If it is, I guess you have an example with offset shape with effects - if not, then it's just coincidental, and maybe the info needed is in another thread.

esapir commented 4 years ago

@f3dm76 It always happens in applyEffects. We identified that bug happens once in a while when coming from background to foreground and the view is actually hidden. In this case draw method is still called and it sometimes causes the deadlock. We currently added a fix that prevent the draw func logic if view is hidden

f3dm76 commented 4 years ago

@esapir Great that you located the issue! Would you maybe want to create a PR so we can fix this for everybody?