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

setting the parent on the constructor of QBoxLayout does not parent correctly the item. On delete of parent this ends up in memory leak

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.15.0 RC2
    • Fix Version/s: None
    • Component/s: Active Qt
    • Labels:
      None
    • Platform/s:
      Linux/Other display system

      Description

      I have a widget and inside it I declare a QBoxLayout and place some children widgets. When the parent gets destroyed, the children persist. No destructor is called to them, like they were not parented correctly.

      To do the parenting of the QBoxLayout, I used the setting of the parent through the constructor, but not the setLayout. According to documentation, these operations should be equivalent.

      Although visually the behavior is correct, valgrind reported memory leak.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            laknoll Lars Knoll
            Reporter:
            foteini Foteini Katsarou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes