Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-88988

(One-time) Memory leak when a png with an icc profile is loaded

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 5.15.2
    • 5.15.2
    • GUI: Painting
    • None
    • Qt 5.15.2 and Visual Studio Community 2019 Version16.8.2
    • All
    • fd839b60a6617a11385326701449fb6825f81eff

    Description

      When call method QLineEdit::setClearButtonEnabled i got memory leak, for example when using below code:

      m_userNameEdit = new QLineEdit(this);
      m_userNameEdit>setClearButtonEnabled(true);-

      I found this leak when I was checking my application for memory leaks using Visual Studio Community 2019 (Version16.8.2):

      Detected memory leaks!
      Dumping objects ->
      {28250} normal block at 0x00000154A53846F0, 352 bytes long.
      Data: < > 01 00 00 00 01 00 00 00 01 00 00 00 03 00 00 00
      Object dump complete.

      If comment out the line with the method, there will be no leak. To find leaks, I used the following code (in main.cpp):

      // Only for Visual studio compliers (detect memory leaks)
      #ifdef _MSC_VER
      #define _CRTDBG_MAP_ALLOC
      #include <stdlib.h>
      #include <crtdbg.h>
      #endif
      ...
      #ifdef _MSC_VER
      // Work only in debug for Visual Studio
      // An automatic call to _CrtDumpMemoryLeaks at each exit point
      _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
      #endif

       

      Simply load a png file with an icc profile.

      Attachments

        1. 1.PNG
          1.PNG
          55 kB
        2. 2.PNG
          2.PNG
          61 kB
        3. 3.PNG
          3.PNG
          43 kB
        4. 4.PNG
          4.PNG
          44 kB
        5. 6.png
          6.png
          27 kB
        6. 7.PNG
          7.PNG
          47 kB
        7. main.cpp
          0.6 kB
        8. main.cpp
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            shemp shemp
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes