summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Vedder <stephan.vedder@gmail.com>2015-05-23 22:43:57 +0200
committerGrigori Goronzy <greg@chown.ath.cx>2015-07-10 10:42:41 +0200
commit08008ea6c8c883825a506629242eb4a13d628f68 (patch)
tree3c083299ad31fba5280e209311ea554b78152d87
parent253d27b5513f1c750f143c940ae71c41730f2040 (diff)
downloadlibass-08008ea6c8c883825a506629242eb4a13d628f68.tar.bz2
libass-08008ea6c8c883825a506629242eb4a13d628f68.tar.xz
directwrite: release localizedStrings
-rw-r--r--libass/ass_directwrite.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libass/ass_directwrite.cpp b/libass/ass_directwrite.cpp
index 743b065..af748a7 100644
--- a/libass/ass_directwrite.cpp
+++ b/libass/ass_directwrite.cpp
@@ -76,7 +76,7 @@ static bool init_font_private(FontPrivate *priv)
if (FAILED(hr) || !stream) {
file->Release();
face->Release();
- return false;
+ return false;
}
priv->stream = stream;
@@ -213,6 +213,8 @@ static void scan_fonts(IDWriteFactory *factory, ASS_FontProvider *provider)
psName = (char*)malloc(size_needed);
WideCharToMultiByte(CP_UTF8, 0, localeName, -1, psName, size_needed, NULL, NULL);
}
+
+ psNames->Release();
hr = font->GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_FULL_NAME, &fontNames, &exists);
if (FAILED(hr))
@@ -231,6 +233,7 @@ static void scan_fonts(IDWriteFactory *factory, ASS_FontProvider *provider)
WideCharToMultiByte(CP_UTF8, 0, localeName, -1, mbName, size_needed, NULL, NULL);
meta.fullnames[k] = mbName;
}
+ fontNames->Release();
hr = fontFamily->GetFamilyNames(&familyNames);
if (FAILED(hr))
@@ -249,6 +252,7 @@ static void scan_fonts(IDWriteFactory *factory, ASS_FontProvider *provider)
WideCharToMultiByte(CP_UTF8, 0, localeName, -1, mbName, size_needed, NULL, NULL);
meta.families[k] = mbName;
}
+ familyNames->Release();
FontPrivate *font_priv = (FontPrivate *)calloc(1, sizeof(*font_priv));
font_priv->font = font;