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:
parent
51791822a1
commit
7cccbaa15e
@ -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 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user