summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaglcontext.mm
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-08-12 13:39:23 +0200
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2011-08-18 09:44:48 +0200
commit6fce65f87129e7f9a02b1dcba73e8cef66c8bbbc (patch)
tree32e1477184d33ee28cfb1e439763a78101574308 /src/plugins/platforms/cocoa/qcocoaglcontext.mm
parentc402d35df807096b199c9f1adfcad4dfabb70697 (diff)
Cocoa: Remove autorelease warnings from qmlscene.
The SG Canvas render thread was creating a QCocoaGLContext without an autorelease pool in place. Change-Id: I08882f42efdf905107497e8be21f2a2d20c3c4cf Reviewed-on: http://codereview.qt.nokia.com/2911 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index c3ff18f980..e10a50b7c0 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -1,5 +1,6 @@
#include "qcocoaglcontext.h"
#include "qcocoawindow.h"
+#include "qcocoaautoreleasepool.h"
#include <qdebug.h>
#include <QtCore/private/qcore_mac_p.h>
#include <QtPlatformSupport/private/cglconvenience_p.h>
@@ -9,6 +10,8 @@
QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformGLContext *share)
: m_format(format)
{
+ QCocoaAutoReleasePool pool; // For the SG Canvas render thread.
+
NSOpenGLPixelFormat *pixelFormat = static_cast <NSOpenGLPixelFormat *>(qcgl_createNSOpenGLPixelFormat());
NSOpenGLContext *actualShare = share ? static_cast<QCocoaGLContext *>(share)->m_context : 0;