Closed FelixHerrmann closed 1 year ago
Thanks for contributing @FelixHerrmann ! We're going to take a look at this and test out on our end
Hey @zplata, any updates? It's been a while.
@FelixHerrmann Sorry for the delay here! Getting a review on this internally, and assuming all goes well, it should merge into this repo in the next day or so here.
No problem, appreciate the update!
@FelixHerrmann hey there! So a few things:
3.1.8
if you want to try it outAwesome, already saw it, thank you for the update!
To 2: No problem at all, the important thing is to have this fix available. How do we want to proceed with this PR? Should I just close it?
Yup, feel free to close this, thanks!
Was contributed via internal repo
The
RiveView
class has a weak reference of theriveModel
which is defined as implicitly unwrapped; theRiveViewModel
stores both (the view and model) references strongly.In certain circumstance the
riveModel
instance get's de-initialized before theriveView
. This causes a crash in the RiveView.advance(delta:) method when the property get's called and is nil:I'm not 100% sure when this actually could happen, but I can constantly reproduce it by trying to present a view controller on a view controller that already presents one (you can see the log message in the screenshot above):
Here is an example project: Rive Crash.zip
It is generally a bad practice to do implicit/force unwraps so I fixed that and handled the optionals in all places!