From 68dcb0f195e70c2bb83d0e0aa03fe17524f53d77 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 10 Feb 2017 13:58:42 -0500 Subject: [PATCH] ControlReference: Add missing virtual destructor ControllerEmu::Control instances have a unique_ptr 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. --- Source/Core/InputCommon/ControlReference/ControlReference.cpp | 2 ++ Source/Core/InputCommon/ControlReference/ControlReference.h | 1 + 2 files changed, 3 insertions(+) diff --git a/Source/Core/InputCommon/ControlReference/ControlReference.cpp b/Source/Core/InputCommon/ControlReference/ControlReference.cpp index 56a1ad133f..1151dedfe4 100644 --- a/Source/Core/InputCommon/ControlReference/ControlReference.cpp +++ b/Source/Core/InputCommon/ControlReference/ControlReference.cpp @@ -52,6 +52,8 @@ ControlReference::ControlReference() : range(1), m_parsed_expression(nullptr) { } +ControlReference::~ControlReference() = default; + InputReference::InputReference() : ControlReference() { } diff --git a/Source/Core/InputCommon/ControlReference/ControlReference.h b/Source/Core/InputCommon/ControlReference/ControlReference.h index e7e6e1a277..fd45ce8b7c 100644 --- a/Source/Core/InputCommon/ControlReference/ControlReference.h +++ b/Source/Core/InputCommon/ControlReference/ControlReference.h @@ -24,6 +24,7 @@ class ControlReference public: static bool InputGateOn(); + virtual ~ControlReference(); virtual ControlState State(const ControlState state = 0) = 0; virtual ciface::Core::Device::Control* Detect(const unsigned int ms, ciface::Core::Device* const device) = 0;