Skip to content

Commit

Permalink
fix memory leak in waveform generation
Browse files Browse the repository at this point in the history
  • Loading branch information
JP Cimalando committed Jan 13, 2017
1 parent a1d4da8 commit e635e95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/calf/osc.h
Expand Up @@ -206,7 +206,9 @@ struct waveform_family: public std::map<uint32_t, float *>
float *wf = new float[SIZE+1];
bl.make_waveform(wf, cutoff, foldover);
wf[SIZE] = wf[0];
(*this)[base * (top / cutoff)] = wf;
float **storage = &(*this)[base * (top / cutoff)];
delete[] *storage;
*storage = wf;
cutoff = (int)(0.75 * cutoff);
}
}
Expand Down

0 comments on commit e635e95

Please sign in to comment.