jingwood / d2dlib

A .NET library for hardware-accelerated, high performance, immediate mode rendering via Direct2D.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CreateTextLayout causes Memory Leak

MightyM7 opened this issue · comments

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

Thanks!