Skip to content

Commit

Permalink
Use proper new/delete for int arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kristjansson committed Dec 11, 2012
1 parent 657e152 commit fba5c6f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mythplugins/mythgallery/mythgallery/sequence.h
Expand Up @@ -116,7 +116,7 @@ class SequenceRandomBase : public SequenceBase
{
if(seq)
{
delete seq;
delete[] seq;
}
};

Expand All @@ -125,9 +125,11 @@ class SequenceRandomBase : public SequenceBase
SequenceBase::reset(_len);
if(seq)
{
delete seq;
delete[] seq;
}
seq = new(int[len]);

seq = new int[len];

for( int i = 0 ; i < len ; i++ )
{
seq[i] = -1;
Expand Down Expand Up @@ -181,7 +183,7 @@ class SequenceShuffle : public SequenceRandomBase
{
if (map)
{
delete map;
delete[] map;
}
};

Expand All @@ -191,10 +193,10 @@ class SequenceShuffle : public SequenceRandomBase

if(map)
{
delete map;
delete[] map;
}

map = new(int[(len / sizeof(int)) + 1]);
map = new int[(len / sizeof(int)) + 1];

for( int i = 0 ; i < len ; i++ )
{
Expand Down

0 comments on commit fba5c6f

Please sign in to comment.