Add Memory utility to detect shutdown.

This commit is contained in:
Unknown W. Brackets committed 2016-05-19 21:17:17 -07:00
1 parent 68717411b1
commit eee98966f4
2 files changed
+9 -6

No files matched your search

+7 -6
View File
@@ -383,18 +383,15 @@ void DoState(PointerWrap &p)
p.DoMarker("ScratchPad");
}
void Shutdown()
{
void Shutdown() {
lock_guard guard(g_shutdownLock);
u32 flags = 0;
MemoryMap_Shutdown(flags);
base = NULL;
base = nullptr;
DEBUG_LOG(MEMMAP, "Memory system shut down.");
}
void Clear()
{
void Clear() {
if (m_pRAM)
memset(GetPointerUnchecked(PSP_GetKernelMemoryBase()), 0, g_MemorySize);
if (m_pScratchPad)
@@ -403,6 +400,10 @@ void Clear()
memset(m_pVRAM, 0, VRAM_SIZE);
}
bool IsActive() {
return base != nullptr;
}
// Wanting to avoid include pollution, MemMap.h is included a lot.
MemoryInitedLock::MemoryInitedLock()
{