mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-13 08:05:58 +01:00
fix crashas
This commit is contained in:
parent
70e4670185
commit
8aff97135b
3 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
});
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue