diff options
| author | Martin Braun <martin.braun@ettus.com> | 2021-01-08 12:25:25 +0100 |
|---|---|---|
| committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-03-04 08:23:50 -0600 |
| commit | 49e5ef81530684998bc4bc0934590cdaa81190ab (patch) | |
| tree | a985c6e7864cb60a33e783910bcf2d072688d114 /host/lib/include/uhdlib/transport | |
| parent | df6c2bebae7af7968165f6ad16e56d3f9fccef52 (diff) | |
| download | uhd-49e5ef81530684998bc4bc0934590cdaa81190ab.tar.gz uhd-49e5ef81530684998bc4bc0934590cdaa81190ab.tar.bz2 uhd-49e5ef81530684998bc4bc0934590cdaa81190ab.zip | |
lib: Add some virtual dtors
Classes where we call delete (implicitly or explicitly) with a virtual
inheritance structure need to declare dtors as virtual.
This reduces compiler warnings with clang. There are no known bugs (yet)
due to this.
Diffstat (limited to 'host/lib/include/uhdlib/transport')
| -rw-r--r-- | host/lib/include/uhdlib/transport/inline_io_service.hpp | 2 | ||||
| -rw-r--r-- | host/lib/include/uhdlib/transport/io_service.hpp | 5 | ||||
| -rw-r--r-- | host/lib/include/uhdlib/transport/link_base.hpp | 8 |
3 files changed, 14 insertions, 1 deletions
diff --git a/host/lib/include/uhdlib/transport/inline_io_service.hpp b/host/lib/include/uhdlib/transport/inline_io_service.hpp index b44b0bad5..e1149cc3c 100644 --- a/host/lib/include/uhdlib/transport/inline_io_service.hpp +++ b/host/lib/include/uhdlib/transport/inline_io_service.hpp @@ -31,7 +31,7 @@ public: return sptr(new inline_io_service()); } - ~inline_io_service(); + virtual ~inline_io_service(); void attach_recv_link(recv_link_if::sptr link) override; void attach_send_link(send_link_if::sptr link) override; diff --git a/host/lib/include/uhdlib/transport/io_service.hpp b/host/lib/include/uhdlib/transport/io_service.hpp index 0cc2f86e3..c97ae49ea 100644 --- a/host/lib/include/uhdlib/transport/io_service.hpp +++ b/host/lib/include/uhdlib/transport/io_service.hpp @@ -104,6 +104,8 @@ class recv_io_if public: using sptr = std::shared_ptr<recv_io_if>; + virtual ~recv_io_if() = default; + /*! * Callback for producing a flow control response (or any other response * needed when a received frame_buff is released via @@ -188,6 +190,8 @@ class send_io_if public: using sptr = std::shared_ptr<send_io_if>; + virtual ~send_io_if() = default; + /*! * Callback for sending the packet. Callback should call release_send_buff() * and update any internal state needed. For example, flow control state @@ -366,6 +370,7 @@ public: io_service() = default; io_service(const io_service&) = delete; io_service& operator=(const io_service&) = delete; + virtual ~io_service() = default; }; }} // namespace uhd::transport diff --git a/host/lib/include/uhdlib/transport/link_base.hpp b/host/lib/include/uhdlib/transport/link_base.hpp index e2b0425bd..76b5c1ee3 100644 --- a/host/lib/include/uhdlib/transport/link_base.hpp +++ b/host/lib/include/uhdlib/transport/link_base.hpp @@ -74,6 +74,8 @@ public: { } + virtual ~send_link_base() = default; + size_t get_num_send_frames() const override { return _num_send_frames; @@ -164,7 +166,13 @@ public: { } +<<<<<<< HEAD size_t get_num_recv_frames() const override +======= + virtual ~recv_link_base() = default; + + virtual size_t get_num_recv_frames() const +>>>>>>> lib: Add some virtual dtors { return _num_recv_frames; } |
