From d2c9de98b52e7e9a4918190b1e7079496d2a13b6 Mon Sep 17 00:00:00 2001
From: Thomas Habets <thomas@habets.se>
Date: Sat, 29 Aug 2020 23:18:16 +0100
Subject: fec: Remove manual memory management

This removes almost all manual memory management in gr-fec/.
`scl_list` is a bit of magic, so requires more thinking.
---
 gr-fec/lib/cc_decoder_impl.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'gr-fec/lib/cc_decoder_impl.h')

diff --git a/gr-fec/lib/cc_decoder_impl.h b/gr-fec/lib/cc_decoder_impl.h
index e39cd9846a..d7d236da21 100644
--- a/gr-fec/lib/cc_decoder_impl.h
+++ b/gr-fec/lib/cc_decoder_impl.h
@@ -43,7 +43,7 @@ private:
                           unsigned int tailsize);
     int find_endstate();
 
-    unsigned char* Branchtab;
+    volk::vector<unsigned char> d_branchtab;
     unsigned char Partab[256];
 
 
@@ -85,6 +85,10 @@ public:
                     bool padded = false);
     ~cc_decoder_impl();
 
+    // Disable copy because of the raw pointers.
+    cc_decoder_impl(const cc_decoder_impl&) = delete;
+    cc_decoder_impl& operator=(const cc_decoder_impl&) = delete;
+
     void generic_work(void* inbuffer, void* outbuffer);
     bool set_frame_size(unsigned int frame_size);
     double rate();
-- 
cgit v1.2.3