Details
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.