Simplify code that destroys plugins and color manager

This reduces some code duplication and ensures that plugins and the
color manager are destroyed while Platform is still valid.
This commit is contained in:
Vlad Zahorodnii 2021-02-23 12:28:48 +02:00
parent e1279e516c
commit 6c9e0781cd
4 changed files with 2 additions and 6 deletions

View file

@ -80,7 +80,6 @@ WaylandTestApplication::~WaylandTestApplication()
if (effects) {
static_cast<EffectsHandlerImpl*>(effects)->unloadAllEffects();
}
destroyPlugins();
delete m_xwayland;
m_xwayland = nullptr;
destroyWorkspace();
@ -90,7 +89,6 @@ WaylandTestApplication::~WaylandTestApplication()
}
waylandServer()->terminateClientConnections();
destroyCompositor();
destroyColorManager();
}
void WaylandTestApplication::performStartup()

View file

@ -148,6 +148,8 @@ void Application::start()
Application::~Application()
{
delete options;
destroyPlugins();
destroyColorManager();
destroyAtoms();
destroyPlatform();
}

View file

@ -136,7 +136,6 @@ ApplicationWayland::~ApplicationWayland()
if (effects) {
static_cast<EffectsHandlerImpl*>(effects)->unloadAllEffects();
}
destroyPlugins();
delete m_xwayland;
m_xwayland = nullptr;
destroyWorkspace();
@ -147,7 +146,6 @@ ApplicationWayland::~ApplicationWayland()
}
waylandServer()->terminateClientConnections();
destroyCompositor();
destroyColorManager();
}
void ApplicationWayland::performStartup()

View file

@ -190,8 +190,6 @@ void ApplicationX11::setReplace(bool replace)
void ApplicationX11::lostSelection()
{
sendPostedEvents();
destroyPlugins();
destroyColorManager();
destroyCompositor();
destroyWorkspace();
// Remove windowmanager privileges