Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Memory leak with addApplicationFont(QString)
Qt 6.11 is out! See what's new in the release blog

Memory leak with addApplicationFont(QString)

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CharlieGC Offline
    CharlieGC Offline
    CharlieG
    wrote on last edited by CharlieG
    #1

    Hello,

    For my application, I want to use the font "Comic Sans MS". For this, I use in the main function this line:

    QFontDatabase fontDB;
    If (! fontDB.families().contains("Comic Sans MS", Qt :: CaseInsensitive)) {
        fontDB.addApplicationFont(QString (":/common/fonts/comic.ttf"));
    }
    

    Unfortunately, I find that in my case, addApplicationFont (QString) creates a memory leak (thanks Valgrind ^^).

    Do you have any idea why?

    In advance, thank you a lot.

    Charlie

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! Maybe it's related to the old QTBUG-59959. If so, please re-open the bug, otherwise you can file a new one.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved