void CStateModule::Pop_State() { // Get the State obj CState* pCurState = Get_Current_State(); if( !pCurState ) { Log(LOG_STATE, "No current state to pop in Pop_State()\n"); return; } DLog(LOG_STATE, "Popping State %d\n", pCurState->GetStateID()); // Stop the current State pCurState->Stop(); // Pop it from the stack and delete m_StateStack.pop_back(); delete pCurState; // Get the new current State pCurState = Get_Current_State(); // Resume it pCurState->Resume(); }