LottieFiles / dotlottie-ios

.lottie player for iOS
MIT License
35 stars 4 forks source link

The player is created every time #14

Closed IvanZakharov16 closed 4 months ago

IvanZakharov16 commented 4 months ago

Good afternoon, Thanks for a great library!

Every time I push View with DotLottieView, a player(Player, DotLottiePlayer) is created each time and is not deleted from memory when I dismiss the View.

It works even with a simple View like: import SwiftUI import DotLottie

struct LottieAnimationSwiftView: View { var body: some View { VStack { DotLottieAnimation(fileName: "lsingb0d", config: AnimationConfig(autoplay: true, loop: true)).view() } } }

Please tell me how to fix this.

Screenshot 2024-02-12 at 14 11 39

samuelOsborne commented 4 months ago

hi @IvanZakharov16 Will look in to this can get back to you shortly

samuelOsborne commented 4 months ago

hi @IvanZakharov16 I've release v0.2.3 that fixes this issue 🎉

Will give you some time to try it out and then will close this issue, thanks for opening it!

IvanZakharov16 commented 4 months ago

thanks for the help! now it works great, but i noticed other memory leaks. I think they're somewhere in C code. Screenshot 2024-03-05 at 11 27 30

samuelOsborne commented 4 months ago

Yes @IvanZakharov16 Its a WIP to remove all the leaks, under the hood we have a rust player using a c++ renderer. For the moment as this issue has been fixed I'll close it but we're working to get rid of these leaks soon! :)