Skip to content

Commit

Permalink
Merge pull request #82 from nikeee/master
Browse files Browse the repository at this point in the history
Fix memory leak
  • Loading branch information
jingwood committed Apr 7, 2022
2 parents 547bdae + a9059cd commit 8e2a9c2
Showing 1 changed file with 3 additions and 2 deletions.
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
//)
//)
//{
//}

0 comments on commit 8e2a9c2

Please sign in to comment.