if(m_playSound)
{
const char* soundToPlay = layout->GetWinName();
char* soundTemp = NULL;
if(m_playAltScatterSndSymbol != -1)
{
for(int i = 0; i < layout->GetNumPositions(); i++)
{
ReelWinSymbolPosition* rwsp = layout->GetReelSymbolPosition(i);
for(int i = 0; i < layout->GetNumPositions(); i++)
{
ReelWinSymbolPosition* rwsp = layout->GetReelSymbolPosition(i);
if(rwsp && rwsp->GetSymbol() == m_playAltScatterSndSymbol)
{
if(m_alternateScatterSndSymbolName && m_alternateScatterSndSymbolName[0] != '\0')
{
CHK_NEW(soundTemp = new char[strlen(m_alternateScatterSndSymbolName) + strlen(soundToPlay)+1])
memset(soundTemp,0,sizeof(soundTemp));
strcpy(soundTemp,m_alternateScatterSndSymbolName);
strcat(soundTemp,soundToPlay);
}
else
return g_log.Error("BlurredReelsController::AnimatingScatter: Alternative scatter sound is empty");
}
}
}
m_playAltScatterSndSymbol = -1;
}
if(soundTemp == NULL)
PlayWinSound(soundToPlay);
else
{
PlayWinSound(soundTemp);
CHK_DELETE_ARRAY(soundTemp); //CHK_DELETE_ARRAY is a #define as delete [] soundTemp; soundTemp= NULL
}
Hi,
Can anyone help me in fixing the memory leak in the above code, the leak is at line number 20 (soundTemp), the
CHK_DELETE_ARRAY(soundTemp) delete the soundTemp pointer, still i see some memory leaks.
Please help !!!
Thanks
SAM