title: OpenGL ES crash on move background, iOS 5.1
body: <p>I have a little issue about my application iOS.
  When i'm using the iOS simulator 5.1 ipad/iphone the application is working, but when i use a real iOS device (iPad and iPhone 5.1 too)</p>
  
  <p>the application crashes when moving on background after clicking on home button...
  with this error:</p>
  
  <pre><code>libGPUSupportMercury.dylib`gpus_ReturnNotPermittedKillClient:
  0x33240094:  trap   
  0x33240096:  nop 
  </code></pre>
  
  <p>I found out that it's was OpenGL ES that was still calculating and making the application crash and found this function: glFinish();</p>
  
  <p>But that still not working here a sample of my code:</p>
  
  <pre><code>- (void)applicationDidBecomeActive:(UIApplication *)application {
      [[CCDirector sharedDirector] resume];
  }
  
  - (void)applicationWillResignActive:(UIApplication *)application {
      glFinish();
      [[CCDirector sharedDirector] pause];
  }
  </code></pre>
  
  <p>I think the problem is just here
  Is there someone who have an idea of my problem ?
  Thanks</p>
  
  <p>EDIT:</p>
  
  <p>Problem solved with that:</p>
  
  <pre><code>- (void)applicationDidEnterBackground:(UIApplication *)application
  {
  [[CCDirector sharedDirector] stopAnimation];
  }
  - (void)applicationWillEnterForeground:(UIApplication *)application
  {
  [[CCDirector sharedDirector] startAnimation];
  }
  </code></pre>
  
  <p>maybe that can help someone x)</p>