From 1e5c7a4c1a694470902e465547505cedd3befa95 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 9 Oct 2026 16:33:31 -0400 Subject: [PATCH] demodssb: Prevent unsafe copying of SSBDemodSink Explicitly delete the copy constructor and copy assignment operator for SSBDemodSink, which manages resources that should not be shared through implicit shallow copies. The implicitly generated copy operations could leave multiple SSBDemodSink instances referring to the same resources, potentially causing invalid ownership or double deletion. Since SSBDemodSink is not intended to be copied or assigned, prohibit both operations at compile time, turning potential runtime errors into compile-time errors. cppcheck identified the missing copy constructor and assignment operator with its noCopyConstructor and noOperatorEq warnings. Signed-off-by: Robin Getz --- plugins/channelrx/demodssb/ssbdemodsink.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/demodssb/ssbdemodsink.h b/plugins/channelrx/demodssb/ssbdemodsink.h index 28ee4c37c..cbe2bc3fe 100644 --- a/plugins/channelrx/demodssb/ssbdemodsink.h +++ b/plugins/channelrx/demodssb/ssbdemodsink.h @@ -37,7 +37,9 @@ class ChannelAPI; class SSBDemodSink : public ChannelSampleSink { public: SSBDemodSink(); - ~SSBDemodSink(); + ~SSBDemodSink(); + SSBDemodSink(const SSBDemodSink&) = delete; + SSBDemodSink& operator=(const SSBDemodSink&) = delete; virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);