mirror of
https://github.com/esuo1198/TaikoArcadeLoader.git
synced 2026-09-27 01:00:23 +03:00
Change to use unique_ptr
This commit is contained in:
+4
-4
@@ -100,9 +100,10 @@ DllMain (HMODULE module, DWORD reason, LPVOID reserved) {
|
||||
// This is bad, dont do this
|
||||
// I/O in DllMain can easily cause a deadlock
|
||||
|
||||
const char *version = "auto";
|
||||
auto configPath = std::filesystem::current_path () / "config.toml";
|
||||
toml_table_t *config = openConfig (configPath);
|
||||
const char *version = "auto";
|
||||
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 amauth = openConfigSection (config, "amauth");
|
||||
if (amauth) {
|
||||
@@ -122,7 +123,6 @@ DllMain (HMODULE module, DWORD reason, LPVOID reserved) {
|
||||
}
|
||||
auto patches = openConfigSection (config, "patches");
|
||||
if (patches) version = readConfigString (patches, "version", version);
|
||||
toml_free (config);
|
||||
}
|
||||
|
||||
if (!strcmp (version, "auto")) {
|
||||
|
||||
Reference in New Issue
Block a user