Fixed memory leak in random_matrix and rainbow_matrix.
This commit is contained in:
parent
af1314632e
commit
2b50691067
@ -144,13 +144,19 @@ MatrixEffect::MatrixEffect() {
|
||||
}
|
||||
|
||||
RandomMatrixEffect::RandomMatrixEffect() {
|
||||
_columns = new MatrixEffectColumn* [window->width];
|
||||
for (int i=0; i<window->width; i++) _columns[i] = new RandomMatrixEffectColumn(window, random8(4), true);
|
||||
// No need to initialize _columns, because that will have been done by ctor of MatrixEffect.
|
||||
for (int i=0; i<window->width; i++) {
|
||||
delete _columns[i];
|
||||
_columns[i] = new RandomMatrixEffectColumn(window, random8(4), true);
|
||||
}
|
||||
}
|
||||
|
||||
RainbowMatrixEffect::RainbowMatrixEffect() {
|
||||
_columns = new MatrixEffectColumn* [window->width];
|
||||
for (int i=0; i<window->width; i++) _columns[i] = new RainbowMatrixEffectColumn(window, MatrixEffectColumn::DIR_SOUTH);
|
||||
// No need to initialize _columns, because that will have been done by ctor of MatrixEffect.
|
||||
for (int i=0; i<window->width; i++) {
|
||||
delete columns[i];
|
||||
_columns[i] = new RainbowMatrixEffectColumn(window, MatrixEffectColumn::DIR_SOUTH);
|
||||
}
|
||||
}
|
||||
|
||||
MatrixEffect::~MatrixEffect() {
|
||||
|
Loading…
Reference in New Issue
Block a user