diff --git a/aegisub/libaegisub/common/path.cpp b/aegisub/libaegisub/common/path.cpp index a52582651..879cd8104 100644 --- a/aegisub/libaegisub/common/path.cpp +++ b/aegisub/libaegisub/common/path.cpp @@ -22,24 +22,25 @@ #include #endif +#include "libaegisub/path.h" + #include "libaegisub/access.h" #include "libaegisub/log.h" -#include "libaegisub/path.h" #include "libaegisub/option.h" #include "libaegisub/option_value.h" namespace agi { Path::Path(const std::string &file, const std::string& default_path) -: path_file(file), -path_default(default_path) { - opt = new agi::Options(file, default_path); +: path_file(file) +, path_default(default_path) +, opt(new agi::Options(file, default_path, Options::FLUSH_SKIP)) +{ opt->ConfigUser(); LOG_D("agi/path") << "New Path object"; } Path::~Path() { - opt->Flush(); } @@ -71,7 +72,6 @@ void Path::Set(const char *name, const std::string &path) { } catch (OptionErrorNotFound&) { throw PathErrorNotFound("Invalid path key"); } - } diff --git a/aegisub/libaegisub/include/libaegisub/path.h b/aegisub/libaegisub/include/libaegisub/path.h index bcc932f18..6b1462ed2 100644 --- a/aegisub/libaegisub/include/libaegisub/path.h +++ b/aegisub/libaegisub/include/libaegisub/path.h @@ -22,6 +22,7 @@ #endif #include +#include namespace agi { @@ -97,7 +98,7 @@ private: void Encode(std::string &path); /// Options object. - Options *opt; + scoped_ptr opt; /// @brief Locale files /// @return Locale location