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

mouse cursor regression (crash) on MacOS

    XMLWordPrintable

    Details

    • Platform/s:
      macOS
    • Commits:
      09f54e99f2e956908f9104181e7d61fa2f6a027d

      Description

      Run the small attached sample. Click on the 1st window to activate it -> crash (see picture of crash point in qnsview.mm)

      The debugger says:
      "[NSCursor set]: message sent to deallocated instance"
      (I have Zombie enabled under XCode 5)

      This is a Cocoa issue of Qt 5.x.
      After some more analysis of the problem, I found the following:

      QCocoaWindow stores a copy of a NSCursor in QCocoaWindow::m_windowCursor (cf. QCocoaWindow::setWindowCursor)
      but this becomes a dangling pointer later when:

      QCocoaCursor::changeCursor is called, which itself calls convertCursor and the line [cocoaCursor release] is reached

      My guess is that this is the root of the problem.

        Attachments

        1. s4.png
          s4.png
          14 kB
        2. test.cpp
          0.5 kB

          Issue Links

          For Gerrit Dashboard: QTBUG-35887
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              liaqi Liang Qi
              Reporter:
              philippe Philippe Goutier
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes