fix: ensure drawing in main thread (layoutSubviews may be called in web thread due to banners)

This commit is contained in:
Mikhail Shulepov 2016-02-13 11:16:35 +03:00
parent eb55a0e603
commit ab17455b18
1 changed files with 4 additions and 1 deletions

View File

@ -266,7 +266,10 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
// Avoid flicker. Issue #350
//[director performSelectorOnMainThread:@selector(drawScene) withObject:nil waitUntilDone:YES];
cocos2d::Director::getInstance()->drawScene();
if ([NSThread isMainThread])
{
cocos2d::Director::getInstance()->drawScene();
}
}
- (void) swapBuffers