mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +01:00
core: fix sourcing config files (#387)
* core: fix sourcing config files The `handleSource` handle relies on `g_pConfigManager`, which therefore needs to be moved before `init`. * core: remove unnecessary unique pointer moves
This commit is contained in:
parent
318c00d6d0
commit
0f66aeac03
1 changed files with 3 additions and 5 deletions
|
@ -72,9 +72,8 @@ int main(int argc, char** argv, char** envp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto configManager = std::make_unique<CConfigManager>(configPath);
|
g_pConfigManager = std::make_unique<CConfigManager>(configPath);
|
||||||
configManager->init();
|
g_pConfigManager->init();
|
||||||
g_pConfigManager = std::move(configManager);
|
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
Debug::log(CRIT, "ConfigManager threw: {}", ex.what());
|
Debug::log(CRIT, "ConfigManager threw: {}", ex.what());
|
||||||
if (std::string(ex.what()).contains("File does not exist"))
|
if (std::string(ex.what()).contains("File does not exist"))
|
||||||
|
@ -84,8 +83,7 @@ int main(int argc, char** argv, char** envp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto hyprlock = std::make_unique<CHyprlock>(wlDisplay, immediate);
|
g_pHyprlock = std::make_unique<CHyprlock>(wlDisplay, immediate);
|
||||||
g_pHyprlock = std::move(hyprlock);
|
|
||||||
g_pHyprlock->run();
|
g_pHyprlock->run();
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
Debug::log(CRIT, "Hyprlock threw: {}", ex.what());
|
Debug::log(CRIT, "Hyprlock threw: {}", ex.what());
|
||||||
|
|
Loading…
Reference in a new issue