Skip to content

Commit

Permalink
pollable_fd_state: Mark destructor protected and make non-virtual
Browse files Browse the repository at this point in the history
The pollable_fd_state is base class for backend-specific fd states.
Those are created and destroyed via backend virtual calls. In that case,
base class destructor doesn't need to be virtual, deleting an object via
derived pointer would call correct destructor on its own. Also, the base
class destructor is marked protected to explicitly disallow deletion via
base-class.

Signed-off-by: Pavel Emelyanov <[email protected]>
  • Loading branch information
xemul authored and avikivity committed Jul 23, 2024
1 parent 643b3c6 commit 97c3005
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/seastar/core/internal/pollable_fd.hh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ using pollable_fd_state_ptr = boost::intrusive_ptr<pollable_fd_state>;
class pollable_fd_state {
unsigned _refs = 0;
public:
virtual ~pollable_fd_state() {}
struct speculation {
int events = 0;
explicit speculation(int epoll_events_guessed = 0) : events(epoll_events_guessed) {}
Expand Down Expand Up @@ -122,6 +121,7 @@ public:
protected:
explicit pollable_fd_state(file_desc fd, speculation speculate = speculation())
: fd(std::move(fd)), events_known(speculate.events) {}
~pollable_fd_state() {};
private:
void maybe_no_more_recv();
void maybe_no_more_send();
Expand Down

0 comments on commit 97c3005

Please sign in to comment.