diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-12 09:34:28 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-12 09:34:28 (GMT) |
commit | 2ccc1336cbcb359e6dc1f4c482d8a188e8dcffb7 (patch) | |
tree | b0544a922478016745c18f8ffb91adeb0ebec7f0 /src | |
parent | 773512d205df2ba7caa28b7b5cdbfbd6787a0967 (diff) | |
parent | 88a417b47b758d35ef67d7a73f9b9a8ef8a843e1 (diff) | |
download | Qt-2ccc1336cbcb359e6dc1f4c482d8a188e8dcffb7.zip Qt-2ccc1336cbcb359e6dc1f4c482d8a188e8dcffb7.tar.gz Qt-2ccc1336cbcb359e6dc1f4c482d8a188e8dcffb7.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fix memory leak.
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/qgl_mac.mm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/opengl/qgl_mac.mm b/src/opengl/qgl_mac.mm index 4d7532e..66fe7d3 100644 --- a/src/opengl/qgl_mac.mm +++ b/src/opengl/qgl_mac.mm @@ -804,17 +804,22 @@ void QGLContext::generateFontDisplayLists(const QFont & /* fnt */, int /* listBa static CFBundleRef qt_getOpenGLBundle() { CFBundleRef bundle = 0; + CFStringRef urlString = QCFString::toCFStringRef(QLatin1String("/System/Library/Frameworks/OpenGL.framework")); QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, - QCFString::toCFStringRef(QLatin1String("/System/Library/Frameworks/OpenGL.framework")), kCFURLPOSIXPathStyle, false); + urlString, kCFURLPOSIXPathStyle, false); if (url) bundle = CFBundleCreate(kCFAllocatorDefault, url); + CFRelease(urlString); return bundle; } void *QGLContext::getProcAddress(const QString &proc) const { - return CFBundleGetFunctionPointerForName(QCFType<CFBundleRef>(qt_getOpenGLBundle()), - QCFString(proc)); + CFStringRef procName = QCFString(proc).toCFStringRef(proc); + void *result = CFBundleGetFunctionPointerForName(QCFType<CFBundleRef>(qt_getOpenGLBundle()), + procName); + CFRelease(procName); + return result; } #ifndef QT_MAC_USE_COCOA /***************************************************************************** |