Skip to content

Commit b4895f2

Browse files
committed
Fix for swapBuffers crash
Former-commit-id: 9f9bd5e
1 parent daa0be4 commit b4895f2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cocos2d/Platforms/iOS/CCDirectorIOS.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,12 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
291291
-(void) viewWillAppear:(BOOL)animated
292292
{
293293
[super viewWillAppear:animated];
294-
[self startAnimation];
294+
295+
UIApplicationState state = UIApplication.sharedApplication.applicationState;
296+
if (state != UIApplicationStateBackground)
297+
{
298+
[self startAnimation];
299+
}
295300
}
296301

297302
-(void) viewDidAppear:(BOOL)animated

0 commit comments

Comments
 (0)