Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory issues with CustomVars and RichMedia #55

Closed
msmigowski opened this issue Mar 22, 2019 · 4 comments
Closed

Memory issues with CustomVars and RichMedia #55

msmigowski opened this issue Mar 22, 2019 · 4 comments

Comments

@msmigowski
Copy link

Hallo,

I had two problems with cycles using this library:

  1. In function @objc public func sendPlay(dynamicRefreshConfiguration: [Int: Int]), line with
self.chronoRefresh = DynamicRefresher(configuration: config) {
            self.sendRefresh()
}

I think here should be [weak self] because this block retains RichMedia object, which has strong reference to DynamicRefresher object.

  1. In CustomVars class, var screen: AbstractScreen! is defined. I think it should be weak var screen: AbstractScreen!, otherwise we get leak because CustomVars is retaining AbstractScreen and vice verse.

What do you think about it?

@nsagnett
Copy link
Contributor

Hi

Thanks for the suggestions !

I add the first in the next release !
For the second one, are you sure the weak reference must be add in CustomVars class and not reverse (if I understand the documentation : https://docs.swift.org/swift-book/LanguageGuide/AutomaticReferenceCounting.html) ?

@msmigowski
Copy link
Author

Due to second issue, I think you should decide where to put weak. It depends on your architecture.

@nsagnett
Copy link
Contributor

OK I see, many thanks we are working on it

@nsagnett
Copy link
Contributor

nsagnett commented Apr 1, 2019

The 2.14.2 version has been released and fix memory leaks detected
Thanks for your help

Regards

@nsagnett nsagnett closed this as completed Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants