ControlReference: Add missing virtual destructor

ControllerEmu::Control instances have a unique_ptr<ControlReference>
member, which is passed either an InputReference or OutputReference.

Without this virtual destructor, deleting a derived class through a
pointer to the base class is undefined behavior.
This commit is contained in:
Lioncash 2017-02-10 13:58:42 -05:00
parent f6d364e37b
commit 68dcb0f195
2 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,8 @@ ControlReference::ControlReference() : range(1), m_parsed_expression(nullptr)
{ {
} }
ControlReference::~ControlReference() = default;
InputReference::InputReference() : ControlReference() InputReference::InputReference() : ControlReference()
{ {
} }

View File

@ -24,6 +24,7 @@ class ControlReference
public: public:
static bool InputGateOn(); static bool InputGateOn();
virtual ~ControlReference();
virtual ControlState State(const ControlState state = 0) = 0; virtual ControlState State(const ControlState state = 0) = 0;
virtual ciface::Core::Device::Control* Detect(const unsigned int ms, virtual ciface::Core::Device::Control* Detect(const unsigned int ms,
ciface::Core::Device* const device) = 0; ciface::Core::Device* const device) = 0;