diff options
author | Thomas Habets <thomas@habets.se> | 2021-02-19 17:38:58 +0000 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-02-26 01:17:25 -0800 |
commit | 4b7006db76b570e4d916e263301333d2f4d2a2df (patch) | |
tree | fb618398b0a1900f2b47749d6a2928570c9ebbf2 /gr-qtgui/lib/sink_c_impl.h | |
parent | 044b4a3b49b67adfe53e0e88f9adf847a25fad61 (diff) |
qtgui: Remove manual memory management
Signed-off-by: Thomas Habets <thomas@habets.se>
Diffstat (limited to 'gr-qtgui/lib/sink_c_impl.h')
-rw-r--r-- | gr-qtgui/lib/sink_c_impl.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gr-qtgui/lib/sink_c_impl.h b/gr-qtgui/lib/sink_c_impl.h index 364d53730a..b78e76048c 100644 --- a/gr-qtgui/lib/sink_c_impl.h +++ b/gr-qtgui/lib/sink_c_impl.h @@ -40,21 +40,24 @@ private: const pmt::pmt_t d_port; - bool d_shift; - fft::fft_complex_fwd* d_fft; + // Perform fftshift operation; + // this is usually desired when plotting + bool d_shift = true; + std::unique_ptr<fft::fft_complex_fwd> d_fft; - int d_index; - gr_complex* d_residbuf; - float* d_magbuf; + int d_index = 0; + volk::vector<gr_complex> d_residbuf; + volk::vector<float> d_magbuf; bool d_plotfreq, d_plotwaterfall, d_plottime, d_plotconst; gr::high_res_timer_type d_update_time; - int d_argc; - char* d_argv; + int d_argc = 1; + char zero = 0; + char* d_argv = &zero; QWidget* d_parent; - SpectrumGUIClass* d_main_gui; + SpectrumGUIClass d_main_gui; void windowreset(); void buildwindow(); @@ -78,6 +81,12 @@ public: bool plotconst, QWidget* parent); ~sink_c_impl() override; + // Disallow copy/move because of the pointers. + sink_c_impl(const sink_c_impl&) = delete; + sink_c_impl(sink_c_impl&&) = delete; + sink_c_impl& operator=(const sink_c_impl&) = delete; + sink_c_impl& operator=(sink_c_impl&&) = delete; + bool check_topology(int ninputs, int noutputs) override; |