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

deleteLater deletes reference to a new dialog when dialog is closed and immediately opened

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.12
    • None
    • Issue occurs on Windows 10 and possibly on Mac and Linux as well.
    • Windows

    Description

      We are using PyQt 5.12.1 but I believe this is underlying Qt issue.

      There are certain cases in our software where we close and immediately open a new dialog programmatically. We are using deleteLater to schedule the deletion of the dialog on receipt of the destroyed signal. However, the deleteLater seems to be deleting the reference to the newly opened dialog and not the previously closed dialog. So, when the new dialog is referenced it shows this error:

      Error: wrapped C/C++ object of type <dialogName> has been deleted on line 386 of file <dialogName>.py

      This doesn't happen when closing and reopening the dialog manually as it gives time for the deleteLater to run before the same dialog is re-opened. 

      Is there a workaround for this?

      We are using the deleteLaters for dialogs as we have seen crashes when closing dialogs on Linux and Mac which the deleteLaters seem to solve.

      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
            akamath Anu Kamath
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes