mirror of https://github.com/snes9xgit/snes9x.git
Fix OpenGL ImGui shutdown. Fix config folder on Windows.
This commit is contained in:
parent
16da4c2d26
commit
fa16fbace4
|
@ -332,6 +332,12 @@ void EmuCanvasOpenGL::paintEvent(QPaintEvent *event)
|
|||
void EmuCanvasOpenGL::deinit()
|
||||
{
|
||||
shader_parameters_dialog.reset();
|
||||
if (ImGui::GetCurrentContext())
|
||||
{
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
|
||||
context.reset();
|
||||
}
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ std::string EmuConfig::findConfigDir()
|
|||
char *dir;
|
||||
fs::path path;
|
||||
|
||||
#ifndef _WIN32
|
||||
if ((dir = getenv("XDG_CONFIG_HOME")))
|
||||
{
|
||||
path = dir;
|
||||
|
@ -158,9 +159,23 @@ std::string EmuConfig::findConfigDir()
|
|||
{
|
||||
path = "./.snes9x";
|
||||
}
|
||||
#else
|
||||
if ((dir = getenv("LOCALAPPDATA")))
|
||||
{
|
||||
path = dir;
|
||||
path /= "Snes9x";
|
||||
}
|
||||
else if ((dir = getenv("APPDATA")))
|
||||
{
|
||||
path = dir;
|
||||
path /= "Snes9x";
|
||||
}
|
||||
else
|
||||
path = "snes9x";
|
||||
#endif
|
||||
|
||||
if (!fs::exists(path))
|
||||
fs::create_directory(path);
|
||||
fs::create_directories(path);
|
||||
|
||||
return path.string();
|
||||
}
|
||||
|
|
|
@ -408,7 +408,7 @@ std::string S9xGetDirectory(s9x_getdirtype dirtype)
|
|||
|
||||
if (!fs::exists(path))
|
||||
{
|
||||
fs::create_directory(path);
|
||||
fs::create_directories(path);
|
||||
}
|
||||
else if ((fs::status(path).permissions() & fs::perms::owner_write) == fs::perms::none)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue