Cocoa: Remove autorelease warnings from qmlscene.
authorMorten Sorvig <morten.sorvig@nokia.com>
Fri, 12 Aug 2011 11:39:23 +0000 (13:39 +0200)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>
Thu, 18 Aug 2011 07:44:48 +0000 (09:44 +0200)
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>
src/plugins/platforms/cocoa/qcocoaglcontext.mm

index c3ff18f..e10a50b 100644 (file)
@@ -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;