summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/Monitor.cpp3
-rw-r--r--src/helpers/ScopeGuard.cpp10
-rw-r--r--src/helpers/ScopeGuard.hpp13
3 files changed, 2 insertions, 24 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 708a5cc8..223a3f94 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -2,7 +2,6 @@
#include "MiscFunctions.hpp"
#include "math/Math.hpp"
#include "sync/SyncReleaser.hpp"
-#include "ScopeGuard.hpp"
#include "../Compositor.hpp"
#include "../config/ConfigValue.hpp"
#include "../protocols/GammaControl.hpp"
@@ -17,7 +16,9 @@
#include "sync/SyncTimeline.hpp"
#include <aquamarine/output/Output.hpp>
#include <hyprutils/string/String.hpp>
+#include <hyprutils/utils/ScopeGuard.hpp>
using namespace Hyprutils::String;
+using namespace Hyprutils::Utils;
int ratHandler(void* data) {
g_pHyprRenderer->renderMonitor((CMonitor*)data);
diff --git a/src/helpers/ScopeGuard.cpp b/src/helpers/ScopeGuard.cpp
deleted file mode 100644
index 319255cd..00000000
--- a/src/helpers/ScopeGuard.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "ScopeGuard.hpp"
-
-CScopeGuard::CScopeGuard(const std::function<void()>& fn_) : fn(fn_) {
- ;
-}
-
-CScopeGuard::~CScopeGuard() {
- if (fn)
- fn();
-}
diff --git a/src/helpers/ScopeGuard.hpp b/src/helpers/ScopeGuard.hpp
deleted file mode 100644
index 8a1468eb..00000000
--- a/src/helpers/ScopeGuard.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-
-#include <functional>
-
-// calls a function when it goes out of scope
-class CScopeGuard {
- public:
- CScopeGuard(const std::function<void()>& fn_);
- ~CScopeGuard();
-
- private:
- std::function<void()> fn;
-};