Skip to content

Commit

Permalink
fix bug in previous doLater cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ikalco committed Dec 3, 2024
1 parent 9218689 commit 6a8c756
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/protocols/XDGShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,14 @@ uint32_t CXDGSurfaceResource::scheduleConfigure() {
if (configureScheduled)
return scheduledSerial;

scheduledSerial = wl_display_next_serial(g_pCompositor->m_sWLDisplay);

scheduledSerial = wl_display_next_serial(g_pCompositor->m_sWLDisplay);
configureScheduled = true;
g_pEventLoopManager->doLater([this]() { configure(); });

// sometimes `this` is unreferencable due to timing, so copy self WP to ensure object is alive
g_pEventLoopManager->doLater([pSelf = self] {
if (!pSelf.expired())
pSelf->configure();
});

return scheduledSerial;
}
Expand Down

0 comments on commit 6a8c756

Please sign in to comment.