From: Philipp Marek Date: Sat, 18 Nov 2017 12:53:24 +0000 (+0100) Subject: Session: Fix mismatched delete operator. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a00f8221dce2af1e88d5eefc7b3689c377f4b72c;p=pulseview.git Session: Fix mismatched delete operator. Mismatched free() / delete / delete [] at 0x4C2D31B: operator delete(void*) (vg_replace_malloc.c:576) by 0x1C76D0: operator() (unique_ptr.h:78) by 0x1C76D0: ~unique_ptr (unique_ptr.h:268) by 0x1C76D0: pv::data::AnalogSegment::append_interleaved_samples(float const*, unsigned long, unsigned long) (analogsegment.cpp:78) ... Address 0x1d123f70 is 0 bytes inside a block of size 312 alloc'd at 0x4C2C97F: operator new[](unsigned long) (vg_replace_malloc.c:423) by 0x1C765E: pv::data::AnalogSegment::append_interleaved_samples(float const*, unsigned long, unsigned long) (analogsegment.cpp:78) by 0x1AFDD5: pv::Session::feed_in_analog(std::shared_ptr) (session.cpp:1142) --- diff --git a/pv/data/analogsegment.cpp b/pv/data/analogsegment.cpp index 0610a4a8..7a3d62d8 100644 --- a/pv/data/analogsegment.cpp +++ b/pv/data/analogsegment.cpp @@ -75,7 +75,7 @@ void AnalogSegment::append_interleaved_samples(const float *data, uint64_t prev_sample_count = sample_count_; // Deinterleave the samples and add them - unique_ptr deint_data(new float[sample_count]); + unique_ptr deint_data(new float[sample_count]); float *deint_data_ptr = deint_data.get(); for (uint32_t i = 0; i < sample_count; i++) { *deint_data_ptr = (float)(*data);