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

Crash when showing parent dialog from child dialog during destruction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.2, 6.0.0
    • None
    • Windows
    • Windows

    Description

      If a child dialog, which is being destroyed by parent's destructor, attempts to show its parent dialog during its destructor, then the application crashes.

       

      I've created a simple example application to demonstrate - click the "Create Dialog 1" button, then click "Open Dialog 2" then "ok" and "ok" to get back to the main window -> application crashes.

       

      I fully realise this is a very convoluted demo to create the crash and no real programmer would write code like this, but I have encountered a real-world crash in our application which was much more reasonable (albeit still not the best code in the world, but not completely crazy either).

       

      Suspect problem will occur on all platforms (have only tried Windows). Only have Qt 5.15.2 and 6.0.0 available to me,

       

      I wonder if the fix would be as simple as adding a check for data.in_destructor to ensurePolished() - or maybe to all QWidget methods that access the children member.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            michael.partridge Michael Partridge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes