Skip to content

[Bug] Frequent reboot game can sometimes cause the core to crash (fault addr 0x0). #216

Description

@TTTUUUIII

The crash occurs in the FlushSecondaryBuffer function within the src/NDSCart_SRAMManager.cpp file when the SecondaryBuffer pointer is nullptr.

diff --git a/src/NDSCart_SRAMManager.cpp b/src/NDSCart_SRAMManager.cpp
index ba31e8c..ebeaec4 100644
--- a/src/NDSCart_SRAMManager.cpp
+++ b/src/NDSCart_SRAMManager.cpp
@@ -69,6 +69,9 @@ void DeInit()
 
     if (SecondaryBuffer) delete SecondaryBuffer;
     SecondaryBuffer = NULL;
+    FlushVersion = 0;
+    PreviousFlushVersion = 0;
+    TimeAtLastFlushRequest = 0;
 
     Platform::Mutex_Free(SecondaryBufferLock);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions