-
Notifications
You must be signed in to change notification settings - Fork 44
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
lvfntman: fix harfbuzz related memory leak on quit #534
lvfntman: fix harfbuzz related memory leak on quit #534
Conversation
if ( SVGGlyphsCollector_svg_funcs == NULL ) { | ||
setup_SVGGlyphsCollector_svg_funcs(); | ||
} | ||
setup_SVGGlyphsCollector_svg_funcs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for moving the check ==NULL inside the function (so, always calling this function that does its work only once) - rather that doing the check here and really calling this function once ?
(This is called for each text segment in SVGs.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's cleaner that way IMHO. I'm not concerned about performance (but I've made setup_SVGGlyphsCollector_svg_funcs
static so the compiler can do its thing). (Note that I do benchmark regularly to avoid regressions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's cleaner that way IMHO
I don't feel the same: one has to go jump at the function to see it's a no-op on next calls.
And I don't trust compilers to intuite the logic I thought about but was lazy to write :)
"memory leak on quit" sounds like the best memory leaks :) |
a2057ef
to
75fcce7
Compare
It makes Valgrind reports tedious to parse, making finding meaningful leaks that much more annoying ;). |
Well, technically, leaks on
This. I'm down to the expected 32 bytes (freetype memory object) in a lot of cases. |
- koreader/crengine#527 - koreader/crengine#528 - koreader/crengine#530 - koreader/crengine#531 - koreader/crengine#532 - koreader/crengine#533 - koreader/crengine#534 - koreader/crengine#535 - koreader/crengine#536 - koreader/crengine#538 - koreader/crengine#539 - koreader/crengine#540 - koreader/crengine#541 - koreader/crengine#542 - koreader/crengine#544
- koreader/crengine#527 - koreader/crengine#528 - koreader/crengine#530 - koreader/crengine#531 - koreader/crengine#532 - koreader/crengine#533 - koreader/crengine#534 - koreader/crengine#535 - koreader/crengine#536 - koreader/crengine#538 - koreader/crengine#539 - koreader/crengine#540 - koreader/crengine#541 - koreader/crengine#542 - koreader/crengine#544
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)