Use clear method to use clear free memory
This commit is contained in:
parent
0929bfc156
commit
d09899722d
2 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
;;;// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
@ -13,6 +13,12 @@ public:
|
|||
explicit FreeRegionManager() = default;
|
||||
~FreeRegionManager() = default;
|
||||
|
||||
// Clear all free regions
|
||||
void Clear() {
|
||||
std::scoped_lock lk(m_mutex);
|
||||
m_free_regions.clear();
|
||||
}
|
||||
|
||||
void SetAddressSpace(void* start, size_t size) {
|
||||
this->FreeBlock(start, size);
|
||||
}
|
||||
|
|
|
@ -592,7 +592,7 @@ private:
|
|||
void Release() {
|
||||
// Make sure we release resources in the correct order
|
||||
// First clear the free region manager to avoid any dangling references
|
||||
free_manager = {};
|
||||
free_manager.Clear();
|
||||
|
||||
if (virtual_map_base != MAP_FAILED) {
|
||||
int ret = munmap(virtual_map_base, virtual_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue