Skip to content

Commit

Permalink
Fix #618, check for lost gl context
Browse files Browse the repository at this point in the history
  • Loading branch information
phoboslab committed Feb 28, 2016
1 parent c7927a3 commit 09fb8ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Ejecta/EJJavaScriptView.m
Expand Up @@ -362,6 +362,11 @@ - (JSValueRef)jsValueForPath:(NSString *)objectPath {
- (void)run:(CADisplayLink *)sender {
if(isPaused) { return; }

// Check for lost gl context before invoking any JS calls
if( glCurrentContext && EAGLContext.currentContext != glCurrentContext ) {
EAGLContext.currentContext = glCurrentContext;
}

// We rather poll for device motion updates at the beginning of each frame instead of
// spamming out updates that will never be seen.
[deviceMotionDelegate triggerDeviceMotionEvents];
Expand Down

0 comments on commit 09fb8ec

Please sign in to comment.