Properly release pixel format and context in QCocoaGLContext.

Change-Id: Idd13924dccc8d7798f463484eeb3c3074f7b51f1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Zeno Albisser 2012-11-27 10:40:45 +01:00 committed by The Qt Project
parent 5e61bbe586
commit f1cc2aaea9
2 changed files with 8 additions and 0 deletions

View File

@ -56,6 +56,7 @@ class QCocoaGLContext : public QPlatformOpenGLContext
{
public:
QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share);
~QCocoaGLContext();
QSurfaceFormat format() const;

View File

@ -65,11 +65,18 @@ QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLCo
[m_context initWithFormat:pixelFormat shareContext:nil];
}
[pixelFormat release];
const GLint interval = 1;
[m_context setValues:&interval forParameter:NSOpenGLCPSwapInterval];
}
QCocoaGLContext::~QCocoaGLContext()
{
[m_context release];
}
// Match up with createNSOpenGLPixelFormat!
QSurfaceFormat QCocoaGLContext::format() const
{