From 192c87b7cda8f7a5f1d270ca586de8fc6fd8da8e Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 9 Oct 2026 16:33:08 -0400 Subject: [PATCH] demodft8: Prevent unsafe copying of FT8DemodSink Explicitly delete the copy constructor and copy assignment operator for FT8DemodSink, which manages resources that should not be shared through implicit shallow copies. The implicitly generated copy operations could leave multiple FT8DemodSink instances referring to the same resources, potentially causing invalid ownership or double deletion. Since FT8DemodSink 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/demodft8/ft8demodsink.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/demodft8/ft8demodsink.h b/plugins/channelrx/demodft8/ft8demodsink.h index d5c5e58e4..d54a2bf7f 100644 --- a/plugins/channelrx/demodft8/ft8demodsink.h +++ b/plugins/channelrx/demodft8/ft8demodsink.h @@ -35,7 +35,9 @@ class FT8Buffer; class FT8DemodSink : public ChannelSampleSink { public: FT8DemodSink(); - ~FT8DemodSink(); + ~FT8DemodSink(); + FT8DemodSink(const FT8DemodSink&) = delete; + FT8DemodSink& operator=(const FT8DemodSink&) = delete; virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);