diff --git a/Source/Project64-core/N64System/N64RomClass.cpp b/Source/Project64-core/N64System/N64RomClass.cpp index 6ddb6c6e6..c7fe82272 100644 --- a/Source/Project64-core/N64System/N64RomClass.cpp +++ b/Source/Project64-core/N64System/N64RomClass.cpp @@ -617,10 +617,9 @@ void CN64Rom::UnallocateRomImage() { m_RomFile.Close(); - //if this value is still set then the image was not created a map - //file but created with VirtualAllocate if (m_ROMImageBase) { + ProtectMemory(m_ROMImage, m_RomFileSize, MEM_READWRITE); delete[] m_ROMImageBase; m_ROMImageBase = NULL; }