Fix memory leak. Now I'm down to 11 leaks for 384 total leaked bytes. It looks like some of those are coming from SDL. Still, I can live with 384 bytes.
This commit is contained in:
@@ -1196,7 +1196,7 @@ CString XENTITYS::Ref2Entity( const char* estr )
|
|||||||
{
|
{
|
||||||
int len = strlen(estr);
|
int len = strlen(estr);
|
||||||
// char* esbuf = es.GetBufferSetLength( len+1 );
|
// char* esbuf = es.GetBufferSetLength( len+1 );
|
||||||
char* szTemp = new char[len+1];
|
char szTemp[len+1];
|
||||||
if( szTemp )
|
if( szTemp )
|
||||||
Ref2Entity( estr, szTemp, len );
|
Ref2Entity( estr, szTemp, len );
|
||||||
es = szTemp;
|
es = szTemp;
|
||||||
@@ -1214,7 +1214,7 @@ CString XENTITYS::Entity2Ref( const char* str )
|
|||||||
return CString(str);
|
return CString(str);
|
||||||
int len = strlen(str) + nEntityCount*10 ;
|
int len = strlen(str) + nEntityCount*10 ;
|
||||||
//char* sbuf = s.GetBufferSetLength( len+1 );
|
//char* sbuf = s.GetBufferSetLength( len+1 );
|
||||||
char* szTemp = new char[len+1];
|
char szTemp[len+1];
|
||||||
if( szTemp )
|
if( szTemp )
|
||||||
Entity2Ref( str, szTemp, len );
|
Entity2Ref( str, szTemp, len );
|
||||||
s = szTemp;
|
s = szTemp;
|
||||||
|
|||||||
Reference in New Issue
Block a user