Fix double release in wxGLCanvas code.
The change in r77699 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/branches/WX_3_0_BRANCH@77740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -98,15 +98,14 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList)
|
|||||||
// available.
|
// available.
|
||||||
const NSOpenGLPixelFormatAttribute
|
const NSOpenGLPixelFormatAttribute
|
||||||
attrsAccel[] = { NSOpenGLPFAAccelerated, 0 };
|
attrsAccel[] = { NSOpenGLPFAAccelerated, 0 };
|
||||||
WXGLPixelFormat testFormat = [NSOpenGLPixelFormat alloc];
|
if ( WXGLPixelFormat testFormat = [[NSOpenGLPixelFormat alloc]
|
||||||
if ( [testFormat initWithAttributes: attrsAccel] )
|
initWithAttributes: attrsAccel] )
|
||||||
{
|
{
|
||||||
// Hardware acceleration is available, use it.
|
// Hardware acceleration is available, use it.
|
||||||
data[p++] = NSOpenGLPFAAccelerated;
|
data[p++] = NSOpenGLPFAAccelerated;
|
||||||
|
[testFormat release];
|
||||||
}
|
}
|
||||||
|
|
||||||
[testFormat release];
|
|
||||||
|
|
||||||
const NSOpenGLPixelFormatAttribute *attribs;
|
const NSOpenGLPixelFormatAttribute *attribs;
|
||||||
if ( !attribList )
|
if ( !attribList )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user