summaryrefslogtreecommitdiff
path: root/src/managers/ProtocolManager.cpp
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2025-03-02 18:57:49 -0600
committerGitHub <noreply@github.com>2025-03-03 01:57:49 +0100
commitf1ef724a87b29a7937cfc328e0c7ea9445a90050 (patch)
treeb2ec038d96ba5ca0692bba9a9b1526e29cc87246 /src/managers/ProtocolManager.cpp
parent474bfcbccd2180a1f8157efec093fc28792234b7 (diff)
protocols: Ensure protocol dtors are called in ProtocolManager dtor (#9521)
Diffstat (limited to 'src/managers/ProtocolManager.cpp')
-rw-r--r--src/managers/ProtocolManager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/managers/ProtocolManager.cpp b/src/managers/ProtocolManager.cpp
index 621a5335..992ace20 100644
--- a/src/managers/ProtocolManager.cpp
+++ b/src/managers/ProtocolManager.cpp
@@ -69,6 +69,11 @@
#include <aquamarine/buffer/Buffer.hpp>
#include <aquamarine/backend/Backend.hpp>
+// ********************************************************************************************
+// * IMPORTANT: make sure to .reset() any protocol UP's you create! (put reset in destructor) *
+// * otherwise Hyprland might crash when exiting. *
+// ********************************************************************************************
+
void CProtocolManager::onMonitorModeChange(PHLMONITOR pMonitor) {
const bool ISMIRROR = pMonitor->isMirror();
@@ -177,6 +182,7 @@ CProtocolManager::CProtocolManager() {
PROTO::hyprlandSurface = makeUnique<CHyprlandSurfaceProtocol>(&hyprland_surface_manager_v1_interface, 2, "HyprlandSurface");
PROTO::contentType = makeUnique<CContentTypeProtocol>(&wp_content_type_manager_v1_interface, 1, "ContentType");
PROTO::colorManagement = makeUnique<CColorManagementProtocol>(&wp_color_manager_v1_interface, 1, "ColorManagement", *PDEBUGCM);
+ // please read the top of this file before adding another protocol
if (*PENABLEXXCM) {
PROTO::xxColorManagement = makeUnique<CXXColorManagementProtocol>(&xx_color_manager_v4_interface, 1, "XXColorManagement");
@@ -257,6 +263,10 @@ CProtocolManager::~CProtocolManager() {
PROTO::securityContext.reset();
PROTO::ctm.reset();
PROTO::hyprlandSurface.reset();
+ PROTO::contentType.reset();
+ PROTO::colorManagement.reset();
+ PROTO::xxColorManagement.reset();
+ PROTO::frogColorManagement.reset();
PROTO::lease.reset();
PROTO::sync.reset();