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

Release does not clear cached UIFont(s) #1

Open
mihaicristiantanase opened this issue Feb 25, 2019 · 1 comment
Open

Release does not clear cached UIFont(s) #1

mihaicristiantanase opened this issue Feb 25, 2019 · 1 comment

Comments

@mihaicristiantanase
Copy link
Owner

mihaicristiantanase commented Feb 25, 2019

In the example below, I use resURL to indicate the URL to "SomeFontName" font.
In the last case, the UIFont is, unexpectedly, not nil, meaning the resources are not fully released.

var font: UIFont!

font = UIFont(name: "SomeFontName", size: 30) // font == nil, as espected

Elefont.eat(at: resURL)
font = UIFont(name: "SomeFontName", size: 30) // font != nil, as espected

Elefont.releaseEverything()
font = UIFont(name: "SomeFontName", size: 22) // font == nil, as espected
font = UIFont(name: "SomeFontName", size: 30) // font != nil, error!
@mihaicristiantanase
Copy link
Owner Author

After some investigation, it seems that the object returned in the last step is the same as in the second step, meaning the system returns a cached value.

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

1 participant