diff options
author | Vaxry <[email protected]> | 2024-04-20 20:16:42 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-04-20 20:16:42 +0100 |
commit | 4ad739ec63c9a11f0537a884ae2a4c56d6bab10b (patch) | |
tree | 0842db7489691fc6e7cbb3cd6d3321dd0d4790b6 /src/hyprerror | |
parent | 1055e6bee677ef9c4ab4d09e43155e00a98a3b49 (diff) | |
download | Hyprland-4ad739ec63c9a11f0537a884ae2a4c56d6bab10b.tar.gz Hyprland-4ad739ec63c9a11f0537a884ae2a4c56d6bab10b.zip |
HookSystem: improve callback safety
Diffstat (limited to 'src/hyprerror')
-rw-r--r-- | src/hyprerror/HyprError.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hyprerror/HyprError.cpp b/src/hyprerror/HyprError.cpp index de386097..7a9e9e87 100644 --- a/src/hyprerror/HyprError.cpp +++ b/src/hyprerror/HyprError.cpp @@ -6,7 +6,7 @@ CHyprError::CHyprError() { m_fFadeOpacity.create(AVARTYPE_FLOAT, g_pConfigManager->getAnimationPropertyConfig("fadeIn"), AVARDAMAGE_NONE); m_fFadeOpacity.registerVar(); - g_pHookSystem->hookDynamic("focusedMon", [&](void* self, SCallbackInfo& info, std::any param) { + static auto P = g_pHookSystem->hookDynamic("focusedMon", [&](void* self, SCallbackInfo& info, std::any param) { if (!m_bIsCreated) return; @@ -14,7 +14,7 @@ CHyprError::CHyprError() { m_bMonitorChanged = true; }); - g_pHookSystem->hookDynamic("preRender", [&](void* self, SCallbackInfo& info, std::any param) { + static auto P2 = g_pHookSystem->hookDynamic("preRender", [&](void* self, SCallbackInfo& info, std::any param) { if (!m_bIsCreated) return; |