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

Use of deleted widget in Cocoa mouse up

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 4.8.2
    • None
    • Mac OS X 10.6.8, Qt/Cocoa 4.8.2

    Description

      In qt_mac_handleMouseEvent (qt_cocoa_helpers_mac.mm), a final if statement handles QEvent::MouseButtonRelease events by checking to see if a delayed enter/leave event should be sent.

      This invokes qt_mac_getTargetForMouseEvent, and is commented with "since the relase[sic] might have closed a window, we dont give the nativeWidget hint".

      The code does pass nativeWidget to qt_mac_getTargetForMouseEvent, however as the comments say this parameter is no longer valid.

      This can be seen in the case where a window contains a button, and clicking the button deletes the window. In that situation nativeWidget will be the button. But since processing the event deleted the window, the button has also been destroyed and so nativeWidget can no longer be dereferenced.

      I think the comments are correct, and qt_mac_getTargetForMouseEvent should be invoked with NULL rather than nativeWidget.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            refnum Dair Grant
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes