Просмотр исходного кода

engine_interface: Add missing virtual destructor

Eliminates a potential bug vector related to inheritance. Plus, we
should generally be specifying the destructor as virtual within purely
virtual interfaces to begin with.
Lioncash 5 лет назад
Родитель
Сommit
31932904c5

+ 2 - 1
src/video_core/engines/engine_interface.h

@@ -4,13 +4,14 @@
 
 
 #pragma once
 #pragma once
 
 
-#include <type_traits>
 #include "common/common_types.h"
 #include "common/common_types.h"
 
 
 namespace Tegra::Engines {
 namespace Tegra::Engines {
 
 
 class EngineInterface {
 class EngineInterface {
 public:
 public:
+    virtual ~EngineInterface() = default;
+
     /// Write the value to the register identified by method.
     /// Write the value to the register identified by method.
     virtual void CallMethod(u32 method, u32 method_argument, bool is_last_call) = 0;
     virtual void CallMethod(u32 method, u32 method_argument, bool is_last_call) = 0;
 
 

+ 1 - 1
src/video_core/engines/fermi_2d.h

@@ -35,7 +35,7 @@ namespace Tegra::Engines {
 class Fermi2D final : public EngineInterface {
 class Fermi2D final : public EngineInterface {
 public:
 public:
     explicit Fermi2D();
     explicit Fermi2D();
-    ~Fermi2D();
+    ~Fermi2D() override;
 
 
     /// Binds a rasterizer to this engine.
     /// Binds a rasterizer to this engine.
     void BindRasterizer(VideoCore::RasterizerInterface* rasterizer);
     void BindRasterizer(VideoCore::RasterizerInterface* rasterizer);

+ 1 - 1
src/video_core/engines/kepler_memory.h

@@ -36,7 +36,7 @@ namespace Tegra::Engines {
 class KeplerMemory final : public EngineInterface {
 class KeplerMemory final : public EngineInterface {
 public:
 public:
     explicit KeplerMemory(Core::System& system_, MemoryManager& memory_manager);
     explicit KeplerMemory(Core::System& system_, MemoryManager& memory_manager);
-    ~KeplerMemory();
+    ~KeplerMemory() override;
 
 
     /// Write the value to the register identified by method.
     /// Write the value to the register identified by method.
     void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;
     void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;

+ 1 - 1
src/video_core/engines/maxwell_dma.h

@@ -188,7 +188,7 @@ public:
     static_assert(sizeof(RemapConst) == 12);
     static_assert(sizeof(RemapConst) == 12);
 
 
     explicit MaxwellDMA(Core::System& system_, MemoryManager& memory_manager_);
     explicit MaxwellDMA(Core::System& system_, MemoryManager& memory_manager_);
-    ~MaxwellDMA();
+    ~MaxwellDMA() override;
 
 
     /// Write the value to the register identified by method.
     /// Write the value to the register identified by method.
     void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;
     void CallMethod(u32 method, u32 method_argument, bool is_last_call) override;