There is no need to define explicitly destructors in derived classes. According to the C++ Standard
If a class has a base class with a virtual destructor, its destructor (whether user- or implicitly-declared) is virtual
Also if you bother about the access control then
An implicitly declared destructor is an inline public member of its class.
The compiler will place the address of its implicitly defined destructor in vtable. So vtable for derived classes will store addresses of destructors of derived classes.
For readability of your code you could write for example
class B: public A
{
virtual void function() override final;
public:
virtual ~B() = default;
}