summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2023-03-06 00:05:12 +1300
committerScott Mansell <phiren@gmail.com>2023-03-06 00:12:26 +1300
commitb7db2510efb44fa9eac5cd353e294b30b9dbdfff (patch)
treeee249ded77b6a14772f1f0616dd1c2d3af1be220 /Source
parent95ce41ac56f2774a1b18a1a1dafd2dadee248616 (diff)
Don't discard ConfigChanged callback handle
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/VideoCommon/AbstractGfx.cpp3
-rw-r--r--Source/Core/VideoCommon/AbstractGfx.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/AbstractGfx.cpp b/Source/Core/VideoCommon/AbstractGfx.cpp
index 6e1c56aa20..7c0cc10355 100644
--- a/Source/Core/VideoCommon/AbstractGfx.cpp
+++ b/Source/Core/VideoCommon/AbstractGfx.cpp
@@ -18,7 +18,8 @@ std::unique_ptr<AbstractGfx> g_gfx;
AbstractGfx::AbstractGfx()
{
- ConfigChangedEvent::Register([this](u32 bits) { OnConfigChanged(bits); }, "AbstractGfx");
+ m_config_changed =
+ ConfigChangedEvent::Register([this](u32 bits) { OnConfigChanged(bits); }, "AbstractGfx");
}
bool AbstractGfx::IsHeadless() const
diff --git a/Source/Core/VideoCommon/AbstractGfx.h b/Source/Core/VideoCommon/AbstractGfx.h
index ac51415806..fff8bbf3f6 100644
--- a/Source/Core/VideoCommon/AbstractGfx.h
+++ b/Source/Core/VideoCommon/AbstractGfx.h
@@ -3,6 +3,7 @@
#pragma once
+#include "Common/HookableEvent.h"
#include "Common/MathUtil.h"
#include "VideoCommon/RenderState.h"
@@ -166,6 +167,9 @@ public:
protected:
AbstractFramebuffer* m_current_framebuffer = nullptr;
const AbstractPipeline* m_current_pipeline = nullptr;
+
+private:
+ Common::EventHook m_config_changed;
};
extern std::unique_ptr<AbstractGfx> g_gfx;