diff options
author | Thomas Habets <thomas@habets.se> | 2020-04-10 10:34:20 +0100 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-04-10 21:38:42 +0200 |
commit | e30b5d796384410db1a4440c0e3692e9a59c508a (patch) | |
tree | 5b650b20f24cb84c42458cd1c46b9dda6b54fd55 /gr-analog/lib/random_uniform_source_impl.cc | |
parent | 8427b6cdd8112f82ddae5815a87334708db5764e (diff) |
analog: Remove manual memory management
Diffstat (limited to 'gr-analog/lib/random_uniform_source_impl.cc')
-rw-r--r-- | gr-analog/lib/random_uniform_source_impl.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gr-analog/lib/random_uniform_source_impl.cc b/gr-analog/lib/random_uniform_source_impl.cc index 08efd397b8..47f613de8d 100644 --- a/gr-analog/lib/random_uniform_source_impl.cc +++ b/gr-analog/lib/random_uniform_source_impl.cc @@ -33,21 +33,20 @@ random_uniform_source_impl<T>::random_uniform_source_impl(int minimum, int seed) : sync_block("random_uniform_source", io_signature::make(0, 0, 0), - io_signature::make(1, 1, sizeof(T))) + io_signature::make(1, 1, sizeof(T))), + d_rng(seed, minimum, maximum) { - d_rng = new gr::random(seed, minimum, maximum); } template <class T> random_uniform_source_impl<T>::~random_uniform_source_impl() { - delete d_rng; } template <class T> int random_uniform_source_impl<T>::random_value() { - return d_rng->ran_int(); + return d_rng.ran_int(); } template <class T> |