diff --git a/Source/Core/Core/HW/MMIO.cpp b/Source/Core/Core/HW/MMIO.cpp index 39ae3187c3..f8cbe9ee18 100644 --- a/Source/Core/Core/HW/MMIO.cpp +++ b/Source/Core/Core/HW/MMIO.cpp @@ -148,12 +148,12 @@ public: virtual void AcceptReadVisitor(ReadHandlingMethodVisitor& v) const { - v.VisitComplex(read_lambda_); + v.VisitComplex(&read_lambda_); } virtual void AcceptWriteVisitor(WriteHandlingMethodVisitor& v) const { - v.VisitComplex(write_lambda_); + v.VisitComplex(&write_lambda_); } private: @@ -313,9 +313,9 @@ void ReadHandler::ResetMethod(ReadHandlingMethod* method) ret = [addr, mask](u32) { return *addr & mask; }; } - virtual void VisitComplex(std::function lambda) + virtual void VisitComplex(const std::function* lambda) { - ret = lambda; + ret = *lambda; } }; @@ -367,9 +367,9 @@ void WriteHandler::ResetMethod(WriteHandlingMethod* method) ret = [ptr, mask](u32, T val) { *ptr = val & mask; }; } - virtual void VisitComplex(std::function lambda) + virtual void VisitComplex(const std::function* lambda) { - ret = lambda; + ret = *lambda; } }; diff --git a/Source/Core/Core/HW/MMIOHandlers.h b/Source/Core/Core/HW/MMIOHandlers.h index b0f41a4fef..7afe9f60b5 100644 --- a/Source/Core/Core/HW/MMIOHandlers.h +++ b/Source/Core/Core/HW/MMIOHandlers.h @@ -88,7 +88,7 @@ class ReadHandlingMethodVisitor public: virtual void VisitConstant(T value) = 0; virtual void VisitDirect(const T* addr, u32 mask) = 0; - virtual void VisitComplex(std::function lambda) = 0; + virtual void VisitComplex(const std::function* lambda) = 0; }; template class WriteHandlingMethodVisitor @@ -96,7 +96,7 @@ class WriteHandlingMethodVisitor public: virtual void VisitNop() = 0; virtual void VisitDirect(T* addr, u32 mask) = 0; - virtual void VisitComplex(std::function lambda) = 0; + virtual void VisitComplex(const std::function* lambda) = 0; }; // These classes are INTERNAL. Do not use outside of the MMIO implementation