summaryrefslogtreecommitdiff
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-06-08 23:03:36 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-06-09 14:09:21 +0000
commit11b5bf3ebe15199e720282e51daf53ace88f6667 (patch)
tree909d4b1f7d1421271d6f1da48e0f7622d79ab254 /src/plugins/platforms
parented8cbdf07ff4797f388f8c509340b0df9ba4a1b3 (diff)
downloadqtbase-11b5bf3ebe15199e720282e51daf53ace88f6667.tar.gz
macOS: Add a few more local autorelease pools to QCocoaGLContext
Prevents buildup of autoreleased NSViews (drawables) in the outer pool of the main runloop, which may not drain as often as we wish. Change-Id: Ifcf7317c50ec243e0d957bf4a19aab8bf34d5dd6 Fixes: QTBUG-84762 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 15456efa20eb302ad2bc130d0d18db7d2fe58f4d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index ccb6e20071..570f897284 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -357,6 +357,8 @@ QCocoaGLContext::~QCocoaGLContext()
bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
{
+ QMacAutoReleasePool pool;
+
qCDebug(lcQpaOpenGLContext) << "Making" << this << "current"
<< "in" << QThread::currentThread() << "for" << surface;
@@ -489,6 +491,8 @@ void QCocoaGLContext::update()
void QCocoaGLContext::swapBuffers(QPlatformSurface *surface)
{
+ QMacAutoReleasePool pool;
+
qCDebug(lcQpaOpenGLContext) << "Swapping" << m_context
<< "in" << QThread::currentThread() << "to" << surface;
@@ -522,6 +526,8 @@ void QCocoaGLContext::swapBuffers(QPlatformSurface *surface)
void QCocoaGLContext::doneCurrent()
{
+ QMacAutoReleasePool pool;
+
qCDebug(lcQpaOpenGLContext) << "Clearing current context"
<< [NSOpenGLContext currentContext] << "in" << QThread::currentThread();