Sobes.tech
Junior — Senior

Implementing a virtual destructor in the base class

livecode

Task condition

Implement a virtual destructor in the base type to ensure proper memory deallocation when deleting objects through a base class pointer.

struct BaseClass {
    // virtual destructor
};

struct DerivedClass : BaseClass {
    // ...
};