diff options
| author | Lee Bousfield <ljbousfield@gmail.com> | 2025-04-18 10:37:51 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-18 17:37:51 +0200 |
| commit | 7631d4c73f08217f3b8b78731e46a437319219da (patch) | |
| tree | 620e65fbc0375bf68b78ae6d70ce0f7e14ec9ccb /src/helpers/Monitor.cpp | |
| parent | ddae3036ca6a1729ffe7854a59184116d2622809 (diff) | |
render, helpers: Call OpenGL destroyMonitorResources on disconnect (#10111)
* render, helpers: Call OpenGL destroyMonitorResources on disconnect
* helpers: Add opengl null check
Diffstat (limited to 'src/helpers/Monitor.cpp')
| -rw-r--r-- | src/helpers/Monitor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 5e2fedd5..197f19d3 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -51,6 +51,8 @@ CMonitor::CMonitor(SP<Aquamarine::IOutput> output_) : state(this), output(output CMonitor::~CMonitor() { events.destroy.emit(); + if (g_pHyprOpenGL) + g_pHyprOpenGL->destroyMonitorResources(self); } void CMonitor::onConnect(bool noRule) { @@ -295,6 +297,8 @@ void CMonitor::onDisconnect(bool destroy) { Debug::log(LOG, "onDisconnect called for {}", output->name); events.disconnect.emit(); + if (g_pHyprOpenGL) + g_pHyprOpenGL->destroyMonitorResources(self); // record what workspace this monitor was on if (activeWorkspace) { @@ -832,7 +836,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) { updateMatrix(); if (WAS10B != enabled10bit || OLDRES != vecPixelSize) - g_pHyprOpenGL->destroyMonitorResources(self.lock()); + g_pHyprOpenGL->destroyMonitorResources(self); g_pCompositor->arrangeMonitors(); |
