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

user::avatar() has a memory leak #45

Closed
maralorn opened this issue Oct 23, 2016 · 4 comments
Closed

user::avatar() has a memory leak #45

maralorn opened this issue Oct 23, 2016 · 4 comments
Assignees
Labels
bug/fix The library doesn't work as expected

Comments

@maralorn
Copy link
Contributor

the user::avatar() method has this scaledAvatar cache list. And everytime we don’t have a scaledAvatar for the given size we generate a new one. Becauso auf KeepAspectRatio, the new avatar will not have the requested size, so we will calculate a new one everytime and the list gets longer and longer.

@maralorn
Copy link
Contributor Author

I am working with avatars anyway, so I already have a fix for that.

@KitsuneRal KitsuneRal added the bug/fix The library doesn't work as expected label Oct 23, 2016
@KitsuneRal
Copy link
Member

Right, now that I looked again at the code, I realised that strict checking for size (on both coordinates) has a big risk to fail due to KeepAspectRatio. I suppose you're still preserving the aspect ratio and change the size checking instead?

@maralorn
Copy link
Contributor Author

maralorn commented Oct 23, 2016

So actually my approach would be to just crop the picture to the requested size.
I have the code for that ready.
I’ll get around to it, soonish.

KitsuneRal added a commit that referenced this issue Nov 25, 2016
Crop avatar to ensure it has exactly the wanted size; Fixes memory leak #45
@KitsuneRal KitsuneRal added this to Must have in Version 0.1 Jun 29, 2017
@KitsuneRal
Copy link
Member

Fixed long ago.

@KitsuneRal KitsuneRal added this to Version 0.1 - In progress in libQuotient 1 Oct 2, 2017
@KitsuneRal KitsuneRal moved this from Version 0.1 - In progress to Version 0.0.5 - In Progress in libQuotient 1 Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/fix The library doesn't work as expected
Projects
Status: Version 0.1 - Released
Version 0.1
Must have
libQuotient 1
  
Version 0.1 - Released
Development

No branches or pull requests

2 participants