mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Fix race conditions in Config Layers
API has been made stricter, layers are now managed with shared pointers, so using them temporarily increased their reference counters. Additionally, any s_layers map has been guarded by a read/write lock, as concurrent write/reads to it were possible.
This commit is contained in:
@ -16,16 +16,12 @@
|
||||
|
||||
namespace Config
|
||||
{
|
||||
using Layers = std::map<LayerType, std::unique_ptr<Layer>>;
|
||||
using ConfigChangedCallback = std::function<void()>;
|
||||
|
||||
// Layer management
|
||||
Layers* GetLayers();
|
||||
void AddLayer(std::unique_ptr<Layer> layer);
|
||||
void AddLayer(std::unique_ptr<ConfigLayerLoader> loader);
|
||||
Layer* GetLayer(LayerType layer);
|
||||
std::shared_ptr<Layer> GetLayer(LayerType layer);
|
||||
void RemoveLayer(LayerType layer);
|
||||
bool LayerExists(LayerType layer);
|
||||
|
||||
void AddConfigChangedCallback(ConfigChangedCallback func);
|
||||
void InvokeConfigChangedCallbacks();
|
||||
|
Reference in New Issue
Block a user