diff --git a/hs_detection/detect/Detection.cpp b/hs_detection/detect/Detection.cpp index db20f7f..2f52779 100644 --- a/hs_detection/detect/Detection.cpp +++ b/hs_detection/detect/Detection.cpp @@ -61,8 +61,8 @@ namespace HSDetection delete[] spikeArea; delete[] hasAHP; - delete[] scale; - delete[] offset; + operator delete[](scale, align_val_t(channelAlign * sizeof(IntVolt))); + operator delete[](offset, align_val_t(channelAlign * sizeof(IntVolt))); } void Detection::step(FloatRaw *traceBuffer, IntFrame chunkStart, IntFrame chunkLen) diff --git a/hs_detection/detect/RollingArray.h b/hs_detection/detect/RollingArray.h index e451dc9..c492359 100644 --- a/hs_detection/detect/RollingArray.h +++ b/hs_detection/detect/RollingArray.h @@ -32,7 +32,7 @@ namespace HSDetection { arrayBuffer = new (memAlign) IntVolt[(IntCalc)(frameMask + 1) * numChannels]; } - ~RollingArray() { delete[] arrayBuffer; } + ~RollingArray() { operator delete[](arrayBuffer, memAlign); } // copy constructor deleted to protect buffer RollingArray(const RollingArray &) = delete;