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

Dangerous design in QWindowsWindow::~QWindowsWindow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.1.0
    • GUI: Window management
    • None

    Description

      In QWindowsWindow::~QWindowsWindow()
      There is a call to:
      QWindowSystemInterface::flushWindowSystemEvents();

      Is that really necessary and good?
      Here follows a crash scenario that took me time to find:

      I have some "mouse move" code that cause the deletion of a popup widget. This causes ~QWindowsWindow() to be called, hence flushWindowSystemEvents() is also called. In turn, this causes a "button up event" to be called, because there was such a pending event.
      This causes, in my code, the deletion of the same popup widget. My "mouse move" and "button up" codes are not meant to be called in the same time. But flushWindowSystemEvents causes this
      Of course, I can fix this on my side. But this flushWindowSystemEvents in ~QWindowsWindow() is a potential trap for all sort of dirty problems.
      IMHO, this is not good design.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              jirauser26727 user-04d21 (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes