mirror of https://github.com/WerWolv/ImHex
fix: Occasional error when loading recent files
This commit is contained in:
parent
0b18930017
commit
3003dea409
|
|
@ -36,6 +36,7 @@ namespace hex {
|
|||
static bool hasPath();
|
||||
static void clearPath();
|
||||
static std::fs::path getPath();
|
||||
static void setPath(const std::fs::path &path);
|
||||
|
||||
static void registerHandler(const Handler &handler) {
|
||||
getHandlers().push_back(handler);
|
||||
|
|
|
|||
|
|
@ -149,4 +149,8 @@ namespace hex {
|
|||
return ProjectFile::s_currProjectPath;
|
||||
}
|
||||
|
||||
void ProjectFile::setPath(const std::fs::path &path) {
|
||||
ProjectFile::s_currProjectPath = path;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -816,9 +816,6 @@ namespace hex {
|
|||
void Window::exitImGui() {
|
||||
delete static_cast<ImGui::ImHexCustomData *>(ImGui::GetIO().UserData);
|
||||
|
||||
ImNodes::PopAttributeFlag();
|
||||
ImNodes::PopAttributeFlag();
|
||||
|
||||
ImGui::SaveIniSettingsToDisk(hex::toUTF8String(this->m_imguiSettingsPath).c_str());
|
||||
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
|
|
|
|||
|
|
@ -480,8 +480,15 @@ namespace hex::plugin::builtin {
|
|||
if (!recentFile.isValid())
|
||||
continue;
|
||||
|
||||
{
|
||||
auto path = ProjectFile::getPath();
|
||||
ProjectFile::clearPath();
|
||||
|
||||
if (auto settings = provider->storeSettings(); !settings.is_null())
|
||||
recentFile.write(settings.dump(4));
|
||||
|
||||
ProjectFile::setPath(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue