Skip to content

BUGFIX: fix massive memory leak in wf::pixdecor::pixdecor_theme_t::get_font_description()#51

Merged
soreau merged 3 commits intosoreau:masterfrom
kernaltrap8:master
Sep 26, 2025
Merged

BUGFIX: fix massive memory leak in wf::pixdecor::pixdecor_theme_t::get_font_description()#51
soreau merged 3 commits intosoreau:masterfrom
kernaltrap8:master

Conversation

@kernaltrap8
Copy link
Copy Markdown
Contributor

Signed-off-by: kernaltrap kernaltrap@gmail.com

A PangoFontDescription* object was being wrapped in a unique_ptr and not properly free'd. The pointer was free'd, but not the object. This fixes all of the visible leaks I can see in wayfire, other than leaks from libgallium.
For reference, this is Heaptrack before and after the patch:
Before:
image
After:
image
The first image is from a Heaptrack recorded over the course of 22 hours, the second is after 40 minutes or so. May not be super accurate, but I'm fairly certain this leak is gone because resizing windows did not cause any pixdecor functions to show up in Heaptrack.

…et_font_description()`

Signed-off-by: kernaltrap <kernaltrap@gmail.com>

A PangoFontDescription* object was being wrapped in a `unique_ptr` and not properly free'd. The pointer was free'd, but not the object. This fixes all of the visible leaks I can see in wayfire, other than leaks from `libgallium`.
Signed-off-by: kernaltrap <kernaltrap@gmail.com>
Copy link
Copy Markdown
Owner

@soreau soreau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me aside from one small thing.

Comment thread src/deco-theme.cpp Outdated
@soreau
Copy link
Copy Markdown
Owner

soreau commented Sep 26, 2025

LGTM, thanks!

@soreau soreau merged commit e16b5c4 into soreau:master Sep 26, 2025
2 checks passed
@kernaltrap8
Copy link
Copy Markdown
Contributor Author

Yay!

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

Successfully merging this pull request may close these issues.

2 participants