Closed clbemre closed 9 hours ago
I don't fully understand if it has an effect, but there is
self.player?.addObserver(self, forKeyPath: self.key_timeControlStatus, options: .new, context: nil
) in PlayerView,
so it may be necessary to add
player?.removeObserver(self, forKeyPath: key_timeControlStatus)
in deinit.
I have some improvement about caching and memory leak
you can try on new release 1.5.5
And also, there is a question about malloc leaks on Stack Overflow for more information
Firstly, thank you for your interest. I'll check.
I just saw small thing.
@objc private func replaceCurrentItemObserver() {
self.player?.replaceCurrentItem(with: nil)
self.player = nil
NotificationCenter.default.removeObserver(self)
player?.removeObserver(self, forKeyPath: "timeControlStatus")
}
Before player?.removeObserver, you assigned nil to the player.
@objc private func replaceCurrentItemObserver() {
self.player?.replaceCurrentItem(with: nil)
NotificationCenter.default.removeObserver(self)
player?.removeObserver(self, forKeyPath: "timeControlStatus")
self.player = nil
}
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
// also i can't understood why passed inject storyData and storyData.stories item together
ForEach(storyData.stories) { model in
StoryDetailView(storyData: storyData,
model: model,
Thank you very much Best Regards
hi again
thanks for your review i have made some changes
storyData(now it is called as viewModel) is allStories viewmodel and it was @EnvironmentObject
changed to @ObservedObject
therefore i am getting it on init
Thank you, have a nice day 🙏🏻
Hello, firstly i want to say it's great library.
But in general, there are memory leaks in the library. I am still looking. One of the ones I found is this;
ImageLoader class remains in memory and doesn't work deinit
I noticed that when we use
URLSession.shared
instead oflet session = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
it is deleted from memory.Can you check? Because I don't know why you use second option.
Thank you, good work