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.
This commit is contained in:
Martin Braun 2021-01-08 12:25:25 +01:00 committed by Aaron Rossetto
parent df6c2bebae
commit 49e5ef8153
6 changed files with 19 additions and 1 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -105,6 +105,7 @@ class adf4001_ctrl
{
public:
adf4001_ctrl(uhd::spi_iface::sptr _spi, int slaveno);
virtual ~adf4001_ctrl() = default;
virtual void set_lock_to_ext_ref(bool external);
private:

View File

@ -59,6 +59,8 @@ class io_service_mgr
public:
using sptr = std::shared_ptr<io_service_mgr>;
virtual ~io_service_mgr() = default;
/*! Connects a pair of links to an I/O service
*
* Call this method to connect a pair of links to an I/O service. For muxed

View File

@ -80,6 +80,8 @@ public:
get_str_type&& get_key,
uhd::gain_group::sptr gain_group);
virtual ~pwr_cal_mgr() = default;
//! Update the gain group (see make());
//
// Not thread-safe: Don't call at the same time as set_power()