Index: OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm
===================================================================
--- OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm (revision 11207)
+++ OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm (revision 11289)
@@ -858,4 +858,6 @@
     _context = NULL;
     _window = NULL;
+    _pixelformat = NULL;
+    
     _updateContext = false;
     _valid = _initialized = true;
@@ -978,6 +980,6 @@
     }
     
-    NSOpenGLPixelFormat* pixelformat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr ];
-    _context = [[NSOpenGLContext alloc] initWithFormat: pixelformat shareContext: sharedContext];
+    _pixelformat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr ];
+    _context = [[NSOpenGLContext alloc] initWithFormat: _pixelformat shareContext: sharedContext];
     
     if (!_context) {
