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

mouse cursor regression (crash) on MacOS

XMLWordPrintable

    • macOS
    • 09f54e99f2e956908f9104181e7d61fa2f6a027d

      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.

        1. s4.png
          14 kB
          user-04d21
        2. test.cpp
          0.5 kB
          user-04d21
        For Gerrit Dashboard: QTBUG-35887
        # Subject Branch Project Status CR V

            liaqi Liang Qi
            jirauser26727 user-04d21 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes