Fix double release in wxGLCanvas code.

The change in r77701 was partially wrong, we shouldn't release Objective-C
object if initializing it failed.

See #16555.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77750 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-09-20 22:07:52 +00:00
parent 51791822a1
commit 7cccbaa15e

View File

@ -98,15 +98,14 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList)
// available.
const NSOpenGLPixelFormatAttribute
attrsAccel[] = { NSOpenGLPFAAccelerated, 0 };
WXGLPixelFormat testFormat = [NSOpenGLPixelFormat alloc];
if ( [testFormat initWithAttributes: attrsAccel] )
if ( WXGLPixelFormat testFormat = [[NSOpenGLPixelFormat alloc]
initWithAttributes: attrsAccel] )
{
// Hardware acceleration is available, use it.
data[p++] = NSOpenGLPFAAccelerated;
[testFormat release];
}
[testFormat release];
const NSOpenGLPixelFormatAttribute *attribs;
if ( !attribList )
{