Commit e39e93a4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

atmo: memory leak

parent 37f6e513
...@@ -35,6 +35,7 @@ CAtmoChannelAssignment::CAtmoChannelAssignment(CAtmoChannelAssignment &source) ...@@ -35,6 +35,7 @@ CAtmoChannelAssignment::CAtmoChannelAssignment(CAtmoChannelAssignment &source)
CAtmoChannelAssignment::~CAtmoChannelAssignment(void) CAtmoChannelAssignment::~CAtmoChannelAssignment(void)
{ {
delete[] m_mappings;
free(m_psz_name); free(m_psz_name);
} }
...@@ -48,14 +49,15 @@ void CAtmoChannelAssignment::setSize(int numChannels) ...@@ -48,14 +49,15 @@ void CAtmoChannelAssignment::setSize(int numChannels)
{ {
if(numChannels != m_num_channels) if(numChannels != m_num_channels)
{ {
delete []m_mappings; delete[] m_mappings;
m_mappings = NULL;
m_num_channels = numChannels; m_num_channels = numChannels;
if(m_num_channels > 0) if(m_num_channels > 0)
{ {
m_mappings = new int[m_num_channels]; m_mappings = new int[m_num_channels];
memset(m_mappings, 0, sizeof(int) * m_num_channels); memset(m_mappings, 0, sizeof(int) * m_num_channels);
} }
else
m_mappings = NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment