Skip to content

Commit

Permalink
Fix some error paths
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoromisato committed Mar 15, 2018
1 parent 80cd904 commit 4f5d06d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Transcendence/CTranscendenceModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,12 @@ ALERROR CTranscendenceModel::StartNewGame (const CString &sUsername, const SNewG
// Initialize the adventure and hand it the player controller.

if (m_Universe.InitAdventure(pPlayerController, retsError) != NOERROR)
{
delete pPlayerController;
delete m_pPlayer;
m_pPlayer = NULL;
return ERR_FAIL;
}

// The remainder of new game start happens in the background thread
// in StartNewGamebackground
Expand All @@ -2645,6 +2650,8 @@ void CTranscendenceModel::StartNewGameAbort (void)
{
if (m_pPlayer)
{
m_Universe.Reinit();

delete m_pPlayer;
m_pPlayer = NULL;
}
Expand Down

0 comments on commit 4f5d06d

Please sign in to comment.