diff --git a/src/protocols/CTMControl.cpp b/src/protocols/CTMControl.cpp index 315941d3..c9e9d098 100644 --- a/src/protocols/CTMControl.cpp +++ b/src/protocols/CTMControl.cpp @@ -8,7 +8,7 @@ #include "../helpers/Monitor.hpp" #include "../helpers/MiscFunctions.hpp" -CHyprlandCTMControlResource::CHyprlandCTMControlResource(SP resource_) : m_resource(resource_) { +CHyprlandCTMControlResource::CHyprlandCTMControlResource(UP&& resource_) : m_resource(std::move(resource_)) { if UNLIKELY (!good()) return; @@ -87,7 +87,7 @@ CHyprlandCTMControlProtocol::CHyprlandCTMControlProtocol(const wl_interface* ifa } void CHyprlandCTMControlProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) { - const auto RESOURCE = m_managers.emplace_back(makeShared(makeShared(client, ver, id))); + const auto& RESOURCE = m_managers.emplace_back(makeUnique(makeUnique(client, ver, id))); if UNLIKELY (!RESOURCE->good()) { wl_client_post_no_memory(client); diff --git a/src/protocols/CTMControl.hpp b/src/protocols/CTMControl.hpp index 0f2faca8..2e3a7673 100644 --- a/src/protocols/CTMControl.hpp +++ b/src/protocols/CTMControl.hpp @@ -12,14 +12,14 @@ class CMonitor; class CHyprlandCTMControlResource { public: - CHyprlandCTMControlResource(SP resource_); + CHyprlandCTMControlResource(UP&& resource_); ~CHyprlandCTMControlResource(); bool good(); void block(); private: - SP m_resource; + UP m_resource; std::unordered_map m_ctms; bool m_blocked = false; @@ -38,7 +38,7 @@ class CHyprlandCTMControlProtocol : public IWaylandProtocol { bool isCTMAnimationEnabled(); // - std::vector> m_managers; + std::vector> m_managers; WP m_manager; //