Skip to content

Commit

Permalink
Fix crash on level unloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed May 5, 2024
1 parent 0c5e010 commit 5770e20
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/xrEngine/IGame_Persistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class ENGINE_API IGame_Persistent :

public:
virtual IGame_Level* CreateLevel() { return nullptr; }
virtual void DestroyLevel(IGame_Level* lvl) { VERIFY(lvl == nullptr); }
virtual void DestroyLevel(IGame_Level*& lvl) { VERIFY(lvl == nullptr); }

virtual void PreStart(pcstr op);
virtual void Start(pcstr op);
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/GamePersistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ IGame_Level* CGamePersistent::CreateLevel()
return xr_new<CLevel>();
}

void CGamePersistent::DestroyLevel(IGame_Level* lvl)
void CGamePersistent::DestroyLevel(IGame_Level*& lvl)
{
xr_delete(lvl);
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/GamePersistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CGamePersistent : public IGame_Persistent
~CGamePersistent() override;

IGame_Level* CreateLevel() override;
void DestroyLevel(IGame_Level* lvl) override;
void DestroyLevel(IGame_Level*& lvl) override;

void PreStart(LPCSTR op) override;
virtual void Start(LPCSTR op);
Expand Down

0 comments on commit 5770e20

Please sign in to comment.