소스 검색

video_core/gpu: Make GPU's destructor virtual

Because of the recent separation of GPU functionality into sync/async
variants, we need to mark the destructor virtual to provide proper
destruction behavior, given we use the base class within the System
class.

Prior to this, it was undefined behavior whether or not the destructor
in the derived classes would ever execute.
Lioncash 7 년 전
부모
커밋
24e2e601d5
3개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      src/video_core/gpu.h
  2. 1 1
      src/video_core/gpu_asynch.h
  3. 1 1
      src/video_core/gpu_synch.h

+ 1 - 1
src/video_core/gpu.h

@@ -123,7 +123,7 @@ class GPU {
 public:
 public:
     explicit GPU(Core::System& system, VideoCore::RendererBase& renderer);
     explicit GPU(Core::System& system, VideoCore::RendererBase& renderer);
 
 
-    ~GPU();
+    virtual ~GPU();
 
 
     struct MethodCall {
     struct MethodCall {
         u32 method{};
         u32 method{};

+ 1 - 1
src/video_core/gpu_asynch.h

@@ -21,7 +21,7 @@ class ThreadManager;
 class GPUAsynch : public Tegra::GPU {
 class GPUAsynch : public Tegra::GPU {
 public:
 public:
     explicit GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer);
     explicit GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer);
-    ~GPUAsynch();
+    ~GPUAsynch() override;
 
 
     void PushGPUEntries(Tegra::CommandList&& entries) override;
     void PushGPUEntries(Tegra::CommandList&& entries) override;
     void SwapBuffers(
     void SwapBuffers(

+ 1 - 1
src/video_core/gpu_synch.h

@@ -16,7 +16,7 @@ namespace VideoCommon {
 class GPUSynch : public Tegra::GPU {
 class GPUSynch : public Tegra::GPU {
 public:
 public:
     explicit GPUSynch(Core::System& system, VideoCore::RendererBase& renderer);
     explicit GPUSynch(Core::System& system, VideoCore::RendererBase& renderer);
-    ~GPUSynch();
+    ~GPUSynch() override;
 
 
     void PushGPUEntries(Tegra::CommandList&& entries) override;
     void PushGPUEntries(Tegra::CommandList&& entries) override;
     void SwapBuffers(
     void SwapBuffers(