fix crashas

This commit is contained in:
Vaxry 2024-07-20 12:39:18 +02:00
parent 70e4670185
commit 8aff97135b
3 changed files with 10 additions and 2 deletions

View file

@ -445,7 +445,10 @@ void CWLSurfaceResource::commitPendingState() {
if (previousBuffer && !previousBuffer->isSynchronous() && !bufferReleased) {
if (previousBuffer->lockedByBackend) {
previousBuffer->hlEvents.backendRelease = previousBuffer->events.backendRelease.registerListener([this, previousBuffer](std::any data) {
previousBuffer->sendReleaseWithSurface(self.lock());
if (!self.expired()) // could be dead in the dtor
previousBuffer->sendReleaseWithSurface(self.lock());
else
previousBuffer->sendRelease();
previousBuffer->hlEvents.backendRelease.reset();
bufferReleased = true;
});

View file

@ -35,7 +35,7 @@ void CWLBufferResource::sendRelease() {
void CWLBufferResource::sendReleaseWithSurface(SP<CWLSurfaceResource> surf) {
sendRelease();
if (!surf->syncobj)
if (!surf || !surf->syncobj)
return;
if (drmSyncobjTimelineSignal(g_pCompositor->m_iDRMFD, &surf->syncobj->releaseTimeline->timeline->handle, &surf->syncobj->releasePoint, 1))

View file

@ -2622,6 +2622,11 @@ bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode
return false;
}
if (!m_pCurrentRenderbuffer) {
Debug::log(ERR, "failed to start a render pass for output {}, no RBO could be obtained", pMonitor->szName);
return false;
}
if (mode == RENDER_MODE_NORMAL) {
damage = pMonitor->damage.getBufferDamage(HL_BUFFER_AGE);
pMonitor->damage.rotate();