<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - AddTempDevFont(const OUString& rFontFileURL) leaks memory on invocation"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=111432#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - AddTempDevFont(const OUString& rFontFileURL) leaks memory on invocation"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=111432">bug 111432</a>
from <span class="vcard"><a class="email" href="mailto:serval2412@yahoo.fr" title="Julien Nabet <serval2412@yahoo.fr>"> <span class="fn">Julien Nabet</span></a>
</span></b>
<pre><a href="https://opengrok.libreoffice.org/xref/core/vcl/quartz/salgdi.cxx#288">https://opengrok.libreoffice.org/xref/core/vcl/quartz/salgdi.cxx#288</a>
288 static bool AddTempDevFont(const OUString& rFontFileURL)
289 {
290 OUString aUSytemPath;
291 OSL_VERIFY( !osl::FileBase::getSystemPathFromFileURL( rFontFileURL,
aUSytemPath ) );
292 OString aCFileName = OUStringToOString( aUSytemPath,
RTL_TEXTENCODING_UTF8 );
293
294 CFStringRef rFontPath = CFStringCreateWithCString(nullptr,
aCFileName.getStr(), kCFStringEncodingUTF8);
295 CFURLRef rFontURL = CFURLCreateWithFileSystemPath(nullptr, rFontPath,
kCFURLPOSIXPathStyle, true);
296
297 CFErrorRef error;
298 bool success = CTFontManagerRegisterFontsForURL(rFontURL,
kCTFontManagerScopeProcess, &error);
299 if (!success)
300 {
301 CFRelease(error);
302 }
303
304 return success;
305 }
rFontPath and rFontURL should be released with this just before the return:
CFRelease( rFontPath );
CFRelease( rFontURL )
I'll take this one.
Alex: if you build from sources, could you give it a try? (1: does it build, 2:
does it help for memory consumption)
Indeed, I won't be able to test before getting back to home after my daytime
job.
BTW, great tool! :-)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>