summaryrefslogtreecommitdiff
path: root/gr-digital/lib/symbol_sync_cc_impl.cc
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.se>2019-12-21 17:49:46 +0000
committerMarcus Müller <marcus@hostalia.de>2020-01-02 23:43:00 +0100
commit067e336102603ccb0cbf92d3d2a8497f1182618b (patch)
treee6203e1e61b41f5afed2d591f61218033c304217 /gr-digital/lib/symbol_sync_cc_impl.cc
parent63be774868b8de73ccc20b8151a30ad88ea971cb (diff)
gr-digital/symbol_sync: Remove needless memory management
Diffstat (limited to 'gr-digital/lib/symbol_sync_cc_impl.cc')
-rw-r--r--gr-digital/lib/symbol_sync_cc_impl.cc23
1 files changed, 7 insertions, 16 deletions
diff --git a/gr-digital/lib/symbol_sync_cc_impl.cc b/gr-digital/lib/symbol_sync_cc_impl.cc
index 66009ff58b..2e358bb991 100644
--- a/gr-digital/lib/symbol_sync_cc_impl.cc
+++ b/gr-digital/lib/symbol_sync_cc_impl.cc
@@ -72,8 +72,6 @@ symbol_sync_cc_impl::symbol_sync_cc_impl(enum ted_type detector_type,
: block("symbol_sync_cc",
io_signature::make(1, 1, sizeof(gr_complex)),
io_signature::makev(1, 4, std::vector<int>(4, sizeof(float)))),
- d_ted(NULL),
- d_interp(NULL),
d_inst_output_period(sps / static_cast<float>(osps)),
d_inst_clock_period(sps),
d_avg_clock_period(sps),
@@ -105,14 +103,14 @@ symbol_sync_cc_impl::symbol_sync_cc_impl(enum ted_type detector_type,
throw std::out_of_range("output samples per symbol must be > 0");
// Timing Error Detector
- d_ted = timing_error_detector::make(detector_type, slicer);
- if (d_ted == NULL)
+ d_ted.reset(timing_error_detector::make(detector_type, slicer));
+ if (d_ted == nullptr)
throw std::runtime_error("unable to create timing_error_detector");
// Interpolating Resampler
- d_interp = interpolating_resampler_ccf::make(
- interp_type, d_ted->needs_derivative(), n_filters, taps);
- if (d_interp == NULL)
+ d_interp.reset(interpolating_resampler_ccf::make(
+ interp_type, d_ted->needs_derivative(), n_filters, taps));
+ if (d_interp == nullptr)
throw std::runtime_error("unable to create interpolating_resampler_ccf");
// Block Internal Clocks
@@ -136,8 +134,8 @@ symbol_sync_cc_impl::symbol_sync_cc_impl(enum ted_type detector_type,
d_interps_per_symbol % sps);
// Symbol Clock Tracking and Estimation
- d_clock = new clock_tracking_loop(
- loop_bw, sps + max_deviation, sps - max_deviation, sps, damping_factor, ted_gain);
+ d_clock.reset(new clock_tracking_loop(
+ loop_bw, sps + max_deviation, sps - max_deviation, sps, damping_factor, ted_gain));
// Timing Error Detector
d_ted->sync_reset();
@@ -153,13 +151,6 @@ symbol_sync_cc_impl::symbol_sync_cc_impl(enum ted_type detector_type,
set_output_multiple(d_osps_n);
}
-symbol_sync_cc_impl::~symbol_sync_cc_impl()
-{
- delete d_ted;
- delete d_interp;
- delete d_clock;
-}
-
//
// Block Internal Clocks
//