void VAppBase::ProcessStartupModules() { if (s_pStartupModules == NULL) return; while (s_pStartupModules->GetSize() > 0 && !VAppBase::Get()->WantsToQuit()) { VStartupModule* pModule = s_pStartupModules->GetAt(0).m_pModule; s_pStartupModules->RemoveAt(0); pModule->Init(); // Run the startup module as long it returns true bool bResult = true; while (bResult) { bResult &= VAppBase::Get()->PlatformRun(); bResult = bResult && pModule->Run(); } pModule->DeInit(); delete pModule; } V_SAFE_DELETE(s_pStartupModules); }
bool VAppIOS::ProcessStartupModule(int iIndex) { VASSERT(iIndex < GetStartupModuleCount()); VStartupModule* pModule = s_pStartupModules->GetAt(iIndex).m_pModule; bool bResult = pModule->Run(); if(static_cast<VAppIOS*>(VAppBase::Get())->WantsToQuit() || !bResult) { pModule->DeInit(); return false; } return true; }