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

Ref Counting of NSView attached to QCocoaGLContext is increasing on each makeCurrent call

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.12.10, 5.15.1
    • 5.12.8, 5.13.2, 5.14.2, 5.15.0
    • QPA
    • None
    • macOS
    • 15456efa20eb302ad2bc130d0d18db7d2fe58f4d (qt/qtbase/dev) 11b5bf3ebe15199e720282e51daf53ace88f6667 (qt/qtbase/5.15) 122a9512fc2e22ace1caf897d9b99ae5a26e9907 (qt/qtbase/5.12)

    Description

      This crash report of OBS is exactly a crash report I received from a bunch of users on macOS 10.15.1 & 10.15.2: https://github.com/obsproject/obs-studio/issues/2293

      The macOS crash reports:

      {{Application Specific Information:
      Refcount overflow in NSResponder or subclass. Too many unbalanced -retains!}}

      One of my user reported having this crash after running the application for 12 days.

      I debugged and found out that if I make a project with two QOpenGLWidgets and make a loop widget1->makeCurrent() / widget2->makeCurrent(), the NSView in qcocoaglcontext (m_context.view) reference count is increase by one on each call.

      I fixed it in the commit: https://github.com/mattbeghin/qtbase/commit/6e95d37de88bbad406b40bfc476b2108a4601e2d

      Replacing "m_context.view" with objectveC call "[m_context view]", and the same for changing "m_context.view = .." => "[m_context setView:...]", solves.

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            mabeghin Matthieu B.
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes