core: avoid crash in done callbacks

fixes #89
This commit is contained in:
Vaxry 2024-09-30 15:05:42 +01:00
parent 4d6d01c495
commit 3b42f6bee2

View file

@ -90,12 +90,7 @@ void CLayerSurface::sendFrame() {
void CLayerSurface::markDirty() {
frameCallback = makeShared<CCWlCallback>(pSurface->sendFrame());
frameCallback->setDone([this](CCWlCallback* r, uint32_t when) {
frameCallback.reset();
if (dirty || !rendered)
g_pHyprpicker->renderSurface(g_pHyprpicker->m_pLastSurface);
});
frameCallback->setDone([this](CCWlCallback* r, uint32_t when) { onCallbackDone(this, when); });
pSurface->sendCommit();
dirty = true;