diff options
| author | John Glover <j@johnglover.net> | 2012-09-10 19:07:18 +0200 | 
|---|---|---|
| committer | John Glover <j@johnglover.net> | 2012-09-10 19:07:18 +0200 | 
| commit | db3bf85c9d043fc52176ef7a432fece900215c8a (patch) | |
| tree | ee07fbab93e875f8cdb13de8f04025704549d920 /src | |
| parent | 386fd1d34f78030b0520497dcf2f295a5d64caac (diff) | |
| download | simpl-db3bf85c9d043fc52176ef7a432fece900215c8a.tar.gz simpl-db3bf85c9d043fc52176ef7a432fece900215c8a.tar.bz2 simpl-db3bf85c9d043fc52176ef7a432fece900215c8a.zip | |
[base] If Frames allocate their own memory, zero
all sample arrays when clear function is called.
Diffstat (limited to 'src')
| -rw-r--r-- | src/simpl/base.cpp | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/src/simpl/base.cpp b/src/simpl/base.cpp index 8086143..1751dd5 100644 --- a/src/simpl/base.cpp +++ b/src/simpl/base.cpp @@ -142,6 +142,13 @@ void Frame::destroy_arrays() {  void Frame::clear() {      clear_peaks();      clear_partials(); + +    if(_alloc_memory) { +        memset(_audio, 0.0, sizeof(sample) * _size); +        memset(_synth, 0.0, sizeof(sample) * _synth_size); +        memset(_residual, 0.0, sizeof(sample) * _size); +        memset(_synth_residual, 0.0, sizeof(sample) * _synth_size); +    }  }  void Frame::clear_peaks() { |