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. Qt Memory Error ?

Qt Memory Error ?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 710 Views
  • 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.
  • P Offline
    P Offline
    Pada_
    wrote on last edited by
    #1

    Windows 8.1 64Bit + Qt Creator 5.4.0 development environment.

    Create a ProxyWidget on the QGraphicsView.

    Save function & load function developed by yourself.

    Save and Recall Function If you execute it repeatedly, the following error occurs.

    Is your computer running out of memory?

    0_1565936173242_load죽는이유1.PNG

    J.HilkJ 1 Reply Last reply
    0
    • P Pada_

      Windows 8.1 64Bit + Qt Creator 5.4.0 development environment.

      Create a ProxyWidget on the QGraphicsView.

      Save function & load function developed by yourself.

      Save and Recall Function If you execute it repeatedly, the following error occurs.

      Is your computer running out of memory?

      0_1565936173242_load죽는이유1.PNG

      J.HilkJ Online
      J.HilkJ Online
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @pada_ said in Qt Memory Error ?:

      Save function & load function developed by yourself.

      chances are high the memory leak happens here


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        It seems you leak GDI resources so it asserts on a HDC so
        i would check all places where you handle images.
        the assert seems to come from

        static inline HDC createDC()
        {
            HDC display_dc = GetDC(0);
            HDC hdc = CreateCompatibleDC(display_dc);
            ReleaseDC(0, display_dc);
            Q_ASSERT(hdc);
            return hdc;
        }
        

        So make sure you are not newing scenes or the view over and over when
        loading.

        P 1 Reply Last reply
        2
        • mrjjM mrjj

          Hi
          It seems you leak GDI resources so it asserts on a HDC so
          i would check all places where you handle images.
          the assert seems to come from

          static inline HDC createDC()
          {
              HDC display_dc = GetDC(0);
              HDC hdc = CreateCompatibleDC(display_dc);
              ReleaseDC(0, display_dc);
              Q_ASSERT(hdc);
              return hdc;
          }
          

          So make sure you are not newing scenes or the view over and over when
          loading.

          P Offline
          P Offline
          Pada_
          wrote on last edited by
          #4

          @mrjj

          Thank you for the good answer.
          Shouldn't it cause thread repainting of the widget?

          1 Reply Last reply
          0
          • Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @pada_ said in Qt Memory Error ?:

            Shouldn't it cause thread repainting of the widget?

            You must not paint on a widget outside the main thread.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            3
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi
              You really need to show your code for
              Save and Recall Function code if we should have a chance to guess
              why your app seems to eat GDI resources and/or leak memory.

              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