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 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 g_gfx;