From 4449b6a96d7ccc768b883172c1ceec89bf8dccca Mon Sep 17 00:00:00 2001 From: root Date: Wed, 18 May 2016 17:22:34 -0400 Subject: [PATCH] Fix beam leak --- dlls/ar2.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/ar2.cpp b/dlls/ar2.cpp index eff173cf..4cac01eb 100644 --- a/dlls/ar2.cpp +++ b/dlls/ar2.cpp @@ -241,6 +241,8 @@ void CAR2::PrimaryAttack() } MyAnim(iAnim); + if( m_pBeam1 ) + UTIL_Remove(m_pBeam1); m_pBeam1 = CBeam::BeamCreate(AR2_BEAM_SPRITE, 40); m_pBeam1->SetFlags(BEAM_FSINE); @@ -268,7 +270,9 @@ void CAR2::PrimaryAttack() void CAR2::Cleaner(void) { - UTIL_Remove(m_pBeam1); + if( m_pBeam1 ) + UTIL_Remove(m_pBeam1); + m_pBeam1 = 0; } void CAR2::SecondaryAttack(void)