Re-use the Wayland AutoDestroyer's lifetime in WaylandIntegration::Private

This commit is contained in:
Ilya Fedin 2023-09-16 04:13:37 +04:00 committed by John Preston
parent 7dbf331e18
commit ad87c2a15e
1 changed files with 1 additions and 2 deletions

View File

@ -42,7 +42,6 @@ struct WaylandIntegration::Private : public AutoDestroyer<QtWayland::wl_registry
QtWayland::org_kde_plasma_surface plasmaSurface(QWindow *window);
std::optional<PlasmaShell> plasmaShell;
rpl::lifetime lifetime;
protected:
void registry_global(
@ -129,7 +128,7 @@ WaylandIntegration *WaylandIntegration::Instance() {
&QObject::destroyed
) | rpl::start_with_next([] {
instance = std::nullopt;
}, instance->_private->lifetime);
}, instance->_private->lifetime());
return true;
}();
if (!instance) return nullptr;