diff --git a/include/aquamarine/backend/DRM.hpp b/include/aquamarine/backend/DRM.hpp index 3b97348..b1c569d 100644 --- a/include/aquamarine/backend/DRM.hpp +++ b/include/aquamarine/backend/DRM.hpp @@ -378,7 +378,7 @@ namespace Aquamarine { struct { Hyprutils::Memory::CSharedPointer allocator; - Hyprutils::Memory::CSharedPointer renderer; + Hyprutils::Memory::CSharedPointer renderer; // may be null if creation fails } rendererState; Hyprutils::Memory::CWeakPointer backend; diff --git a/src/allocator/GBM.cpp b/src/allocator/GBM.cpp index d22d3a8..67151f7 100644 --- a/src/allocator/GBM.cpp +++ b/src/allocator/GBM.cpp @@ -192,7 +192,8 @@ Aquamarine::CGBMBuffer::CGBMBuffer(const SAllocatorBufferParams& params, Hypruti if (params.scanout && swapchain->backendImpl->type() == AQ_BACKEND_DRM) { // clear the buffer using the DRM renderer to avoid uninitialized mem auto impl = (CDRMBackend*)swapchain->backendImpl.get(); - impl->rendererState.renderer->clearBuffer(this); + if (impl->rendererState.renderer) + impl->rendererState.renderer->clearBuffer(this); } } diff --git a/src/backend/drm/DRM.cpp b/src/backend/drm/DRM.cpp index ba45ea9..8bb8837 100644 --- a/src/backend/drm/DRM.cpp +++ b/src/backend/drm/DRM.cpp @@ -302,7 +302,7 @@ void Aquamarine::CDRMBackend::restoreAfterVT() { }; auto& STATE = c->output->state->state(); - auto& MODE = STATE.customMode ? STATE.customMode : STATE.mode; + auto& MODE = STATE.customMode ? STATE.customMode : STATE.mode; if (!MODE) { backend->log(AQ_LOG_WARNING, "drm: Connector {} has output but state has no mode, will send a reset state event later.");