Skip to content

Commit 0d9e944

Browse files
committed
Fix memory leak on LfpViewer
1 parent a04a878 commit 0d9e944

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Source/Processors/LfpDisplayNode/LfpDisplayNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LfpDisplayNode::LfpDisplayNode()
3333
//std::cout << " LFPDisplayNodeConstructor" << std::endl;
3434
displayBuffer = new AudioSampleBuffer(8, 100);
3535

36-
arrayOfOnes = new float[5000];
36+
arrayOfOnes.malloc(5000);
3737

3838
for (int n = 0; n < 5000; n++)
3939
{

Source/Processors/LfpDisplayNode/LfpDisplayNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class LfpDisplayNode : public GenericProcessor
9999

100100
int64 bufferTimestamp;
101101
std::map<int, int> ttlState;
102-
float* arrayOfOnes;
102+
HeapBlock<float> arrayOfOnes;
103103
int totalSamples;
104104

105105
bool resizeBuffer();

0 commit comments

Comments
 (0)