From 26d8a0b860184eec5d9b320a16f8d7df1f936396 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 21 Jul 2004 06:13:57 +0000 Subject: [PATCH] Fix memory leak. Before: 51057 leaks for 850704 total leaked bytes. After: 21258 leaks for 359284 total leaked bytes. Both of these were taken right after the songs finish loading and the first screen is shown. --- stepmania/src/XmlFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index 36f9439203..9dab12106b 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -173,14 +173,14 @@ void _SetString( char* psz, char* end, CString* ps, bool trim = false, int escap { len = _tcselen( escape, psz, end ); // char* pss = ps->GetBufferSetLength( len ); - char* szTemp = new char[len]; + char szTemp[len]; strlen( szTemp, escape, psz, end ); *ps = szTemp; } else { // char* pss = ps->GetBufferSetLength(len + 1 ); - char* szTemp = new char[len+1]; + char szTemp[len+1]; memcpy( szTemp, psz, len ); szTemp[len] = '\0'; *ps = szTemp;