Skip to content

Commit

Permalink
Fix unmap of lightrec codebuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachCook committed Sep 18, 2024
1 parent c3a4eaa commit cc3e61b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ int lightrec_init_mmap(bool hugetlb)

err_unmap:
if(lightrec_codebuffer){
UNMAP(lightrec_codebuffer, BIOS_SIZE);
UNMAP(lightrec_codebuffer, LIGHTREC_CODEBUFFER_SIZE);
lightrec_codebuffer = NULL;
}

Expand Down Expand Up @@ -1987,6 +1987,9 @@ void lightrec_free_mmap()
for (int i = 0; i < NUM_MEM; i++)
UNMAP((void *)((uintptr_t)psx_mem + i * RAM_SIZE), RAM_SIZE);

if (lightrec_codebuffer)
UNMAP(lightrec_codebuffer, LIGHTREC_CODEBUFFER_SIZE);

UNMAP(psx_bios, BIOS_SIZE);
UNMAP(psx_scratch, SCRATCH_SIZE);

Expand Down Expand Up @@ -2526,6 +2529,8 @@ static void Cleanup(void)
BIOSROM = NULL;
if(psx_mmap > 0)
lightrec_free_mmap();
if(lightrec_codebuffer)
lightrec_codebuffer = NULL;
#else
if(MainRAM != INVALID_PTR)
delete MainRAM;
Expand Down

0 comments on commit cc3e61b

Please sign in to comment.