From 88adba58921be40a0b3ab1abd9efbe664be8e04d Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 19 Nov 2012 22:06:37 +1100 Subject: [PATCH] Code Refactoring: Change location of call change --- Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 2c5b50d1e..c6cc2664d 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -17,14 +17,16 @@ CMipsMemoryVM::CMipsMemoryVM ( CMipsMemory_CallBack * CallBack, bool SavesReadOn m_RomWrittenTo(false), m_RomWroteValue(0) { + g_Settings->RegisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged); m_RDRAM = NULL; m_DMEM = NULL; m_IMEM = NULL; - m_HalfLine = 0; + m_HalfLine = 0; } CMipsMemoryVM::~CMipsMemoryVM (void) { + g_Settings->UnregisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged); FreeMemory(); } @@ -125,15 +127,11 @@ BOOL CMipsMemoryVM::Initialize ( void ) return false; } Reset(false); - g_Settings->RegisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged); - return true; } void CMipsMemoryVM::FreeMemory ( void ) { - g_Settings->UnregisterChangeCB(Game_RDRamSize,this,(CSettings::SettingChangedFunc)RdramChanged); - if (m_RDRAM) { VirtualFree( m_RDRAM, 0 , MEM_RELEASE);