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

Fix memory leak #82

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/d2dlib/Text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ D2DLIB_API HANDLE CreateTextLayout(HANDLE ctx, LPCWSTR text, LPCWSTR fontName, F
);

if (SUCCEEDED(hr) && textLayout != NULL) {
SafeRelease(&textFormat);
return (HANDLE)textLayout;
}
}
Expand All @@ -109,7 +110,7 @@ D2DLIB_API void MeasureText(HANDLE ctx, LPCWSTR text, LPCWSTR fontName, FLOAT fo
SafeRelease(&textLayout);
}

void DrawGlyphRun(HANDLE ctx, D2D1_POINT_2F baselineOrigin,
void DrawGlyphRun(HANDLE ctx, D2D1_POINT_2F baselineOrigin,
const DWRITE_GLYPH_RUN *glyphRun, D2D1_COLOR_F color,
DWRITE_MEASURING_MODE measuringMode)
{
Expand All @@ -121,6 +122,6 @@ void DrawGlyphRun(HANDLE ctx, D2D1_POINT_2F baselineOrigin,
// [in] IDWriteTextLayout *textLayout,
// [in] ID2D1Brush *defaultForegroundBrush,
// D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE
//)
//)
//{
//}