mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Fix heap-use-after-free when quitting/restarting
Items and particles were also rendered in the client states quitting and restarting, which was causing accesses to the already freed map data.
This commit is contained in:
parent
03d17a98ed
commit
f3e8513477
|
@ -358,7 +358,7 @@ void CItems::RenderLaser(const CLaserData *pCurrent, bool IsPredicted)
|
|||
|
||||
void CItems::OnRender()
|
||||
{
|
||||
if(Client()->State() < IClient::STATE_ONLINE)
|
||||
if(Client()->State() != IClient::STATE_ONLINE && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
return;
|
||||
|
||||
bool IsSuper = m_pClient->IsLocalCharSuper();
|
||||
|
|
|
@ -145,7 +145,7 @@ void CParticles::Update(float TimePassed)
|
|||
|
||||
void CParticles::OnRender()
|
||||
{
|
||||
if(Client()->State() < IClient::STATE_ONLINE)
|
||||
if(Client()->State() != IClient::STATE_ONLINE && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
return;
|
||||
|
||||
set_new_tick();
|
||||
|
|
Loading…
Reference in a new issue