[Libreoffice-bugs] [Bug 111432] AddTempDevFont(const OUString& rFontFileURL) leaks memory on invocation

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Aug 7 13:18:45 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=111432

--- Comment #10 from Julien Nabet <serval2412 at yahoo.fr> ---
https://opengrok.libreoffice.org/xref/core/vcl/quartz/salgdi.cxx#288

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! :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170807/75c167d5/attachment.html>


More information about the Libreoffice-bugs mailing list