C ++ repeatedly gives you the feeling that you still do not understand even the fundamental concepts. In this case: Inheritance.
By adding print instructions to ctors and dtors, you will find that for both pointers (old style and smart pointer) only ~ A is called, not ~ B. This is because dtor is not virtual.
: " . - , "
,
struct A {
virtual ~A() = default;
};