mirror of
https://github.com/esuo1198/TaikoArcadeLoader.git
synced 2026-10-12 17:18:09 +03:00
Change to use unique_ptr
This commit is contained in:
@@ -124,8 +124,9 @@ Init () {
|
||||
INSTALL_HOOK (HaspGetInfo);
|
||||
INSTALL_HOOK (HaspRead);
|
||||
|
||||
auto configPath = std::filesystem::current_path () / "config.toml";
|
||||
toml_table_t *config = openConfig (configPath);
|
||||
auto configPath = std::filesystem::current_path () / "config.toml";
|
||||
std::unique_ptr<toml_table_t, void (*) (toml_table_t *)> config_ptr (openConfig (configPath), toml_free);
|
||||
toml_table_t *config = config_ptr.get ();
|
||||
if (config) {
|
||||
auto patches = openConfigSection (config, "patches");
|
||||
if (patches) {
|
||||
@@ -145,7 +146,6 @@ Init () {
|
||||
modeCollabo026 = readConfigBool (cn_jun_2023, "mode_collabo026", modeCollabo026);
|
||||
}
|
||||
}
|
||||
toml_free (config);
|
||||
}
|
||||
|
||||
// Apply common config patch
|
||||
|
||||
Reference in New Issue
Block a user