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

CreateTextLayout causes Memory Leak #79

Closed
MightyM7 opened this issue Dec 27, 2021 · 1 comment · Fixed by #82
Closed

CreateTextLayout causes Memory Leak #79

MightyM7 opened this issue Dec 27, 2021 · 1 comment · Fixed by #82

Comments

@MightyM7
Copy link

Hi,

the function CreateTextLayout in Text.cpp causes a memory leak by not releasing the textFormat in case of returning the textLayout (line 87).

Old:

if (SUCCEEDED(hr) && textLayout != NULL) { return (HANDLE)textLayout; }

Correct:

if (SUCCEEDED(hr) && textLayout != NULL) { SafeRelease(&textFormat); return (HANDLE)textLayout; }

Regards

@jingwood
Copy link
Owner

Thanks!

nikeee added a commit to nikeee/d2dlib that referenced this issue Apr 6, 2022
@nikeee nikeee mentioned this issue Apr 6, 2022
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 a pull request may close this issue.

2 participants