第三方SDK,home键切换回来后场景pause了

项目接入第三方SDK(XY助手)后,按home键切换进程回来后,游戏场景pause了。
打断点发现是applicationWillEnterForeground监听回调中的判定glview == currentView不正确导致。
第三方SDK有自由的内置界面。所以想问一下如何处理。

  • (void)applicationWillEnterForeground:(UIApplication )application {
    /

    Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
    /
    auto glview = (__bridge CCEAGLView
    )(Director::getInstance()->getOpenGLView()->getEAGLView());
    auto currentView = [[[[UIApplication sharedApplication] keyWindow] subviews] lastObject];
    if (glview == currentView) {
    cocos2d::Application::getInstance()->applicationWillEnterForeground();
    }
    }

好像是碰到过。我这边是微信登陆,切换回来出现过按钮无法点击的情况。

http://forum.cocos.com/t/topic/47495

谢谢,我自己是注释掉解决了。
但是这样写这个逻辑的意义在哪里?肯定是因为某些问题才写了这个判定。
所以我想问一下具体更合理的处理方式

应该是这的代码逻辑不完整导致的,gv和cv不是一个对象了,注释掉没有问题