Skip to content

API:IDrawable virtual destructor non-implemented, potential undefined behaviour #151

@litelawliet

Description

@litelawliet

Description
The class IDrawable in OvUI::API doesn't contains a virtual destructor. It sounds harmless and it might be since compilers probably fills that by itself, however the lack of a virtual destructor in this situation may result in an undefined behavior when deleting a derived-class.

Expected resolution
For good mesure and best practice it is better to define that virtual destructor by ourself in IDrawable by adding :

protected:
    virtual ~IDrawable() = default;

That should guarantee a proper dynamic dispatch mechanism when destroying at runtime (derived-class to base-class)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueAn easy issue for new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions