mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
Store environment variables and use on restart (#380)
- Fixes WerWolv/ImHex#373
This commit is contained in:
@@ -16,7 +16,7 @@ namespace hex {
|
||||
void ImHexApi::Common::restartImHex() {
|
||||
EventManager::post<RequestCloseImHex>(false);
|
||||
std::atexit([]{
|
||||
execve(SharedData::mainArgv[0], SharedData::mainArgv, nullptr);
|
||||
execve(SharedData::mainArgv[0], SharedData::mainArgv, SharedData::mainEnvp);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -86,4 +86,4 @@ namespace hex {
|
||||
return Task(unlocalizedName, maxValue);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace hex {
|
||||
|
||||
int SharedData::mainArgc;
|
||||
char **SharedData::mainArgv;
|
||||
char **SharedData::mainEnvp;
|
||||
|
||||
ImFontAtlas *SharedData::fontAtlas;
|
||||
ImFontConfig SharedData::fontConfig;
|
||||
@@ -53,4 +54,4 @@ namespace hex {
|
||||
float SharedData::fontScale;
|
||||
|
||||
std::map<std::string, std::any> SharedData::sharedVariables;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user