Skip to content

Commit ace6c92

Browse files
chkothetstenner
authored andcommitted
move_or_drop should destroy sample_p on drop
1 parent b56f997 commit ace6c92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/consumer_queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class consumer_queue {
135135
inline static void copy_or_move(sample_p &dst, const sample_p &src) { dst = src; }
136136
inline static void copy_or_move(sample_p &dst, sample_p &&src) { dst = std::move(src); }
137137
// helper to either move or drop a value, depending on whether a dst argument is given
138-
inline static void move_or_drop(sample_p & /*unused*/) {}
138+
inline static void move_or_drop(sample_p &src) { src.~sample_p(); }
139139
inline static void move_or_drop(sample_p &src, sample_p &dst) { dst = std::move(src); }
140140
// helper to add a delta to the given index and wrap correctly
141141
FORCEINLINE std::size_t add_wrap(std::size_t x, std::size_t delta) const {

0 commit comments

Comments
 (0)